Revert "removing custom text from the hash"

This reverts commit 3b01cd4f19.
This commit is contained in:
Miodec 2022-03-16 23:00:18 +01:00
parent 3b01cd4f19
commit 7ee40b6b6f
2 changed files with 2 additions and 5 deletions

View file

@ -75,7 +75,6 @@ class ResultController {
const resulthash = result.hash;
delete result.hash;
delete result.strigified;
delete result.customText;
if (
req.ctx.configuration.resultObjectHashCheck.enabled &&
resulthash.length === 64

View file

@ -1071,7 +1071,7 @@ export async function addWord(): Promise<void> {
interface CompletedEvent extends MonkeyTypes.Result<MonkeyTypes.Mode> {
keySpacing: number[] | "toolong";
keyDuration: number[] | "toolong";
customText?: MonkeyTypes.CustomText;
customText: MonkeyTypes.CustomText;
smoothConsistency: number;
wpmConsistency: number;
lang: string;
@ -1500,9 +1500,7 @@ export async function finish(difficultyFailed = false): Promise<void> {
AccountButton.loading(true);
completedEvent.challenge = ChallengeContoller.verify(completedEvent);
if (completedEvent.challenge === null) delete completedEvent?.challenge;
const toHash = Object.assign({}, completedEvent);
delete toHash.customText;
completedEvent.hash = objecthash(toHash);
completedEvent.hash = objecthash(completedEvent);
const response = await Ape.results.save(completedEvent);