Skip to content

Commit 4678fab

Browse files
committed
fixed case ambiguity on vdf solution op.
1 parent c49697c commit 4678fab

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/randomness-beacon/model/BeaconValueOp.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class BeaconValueOp extends MutationOp {
2828

2929
if (seq !== undefined && vdfResult !== undefined) {
3030
this.seq = seq;
31-
this.vdfResult = vdfResult;
31+
this.vdfResult = vdfResult.toUpperCase();
3232
}
3333
}
3434

@@ -109,8 +109,10 @@ class BeaconValueOp extends MutationOp {
109109

110110
const steps = (this.getTarget() as Beacon).steps as number;
111111

112-
113-
//TODO: make sure there is no upper/lowercase ambiguity in the vdfResult!
112+
if (this.vdfResult.toUpperCase() !== this.vdfResult) {
113+
BeaconValueOp.log.trace('VDF result is not uppercase');
114+
return false;
115+
}
114116

115117
const challengeBuffer = Buffer.from(challenge, 'hex');
116118
const resultBuffer = Buffer.from(this.vdfResult, 'hex');

0 commit comments

Comments
 (0)