Skip to content

Commit

Permalink
Fixed TypedData unsigned value range (#3873).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Apr 5, 2023
1 parent 356ff2b commit a851b24
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src.ts/hash/typed-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function getBaseEncoder(type: string): null | ((value: any) => string) {

assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${ type }`, "value", value);

return toBeHex(toTwos(value, 256), 32);
return toBeHex(signed ? toTwos(value, 256): value, 32);
};
}
}
Expand Down
Binary file modified testcases/typed-data.json.gz
Binary file not shown.

0 comments on commit a851b24

Please sign in to comment.