Skip to content

Commit

Permalink
fix: interpret 0x as hex in bytes encodeField
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Nov 20, 2023
1 parent 8b0fb09 commit aae514f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sign-typed-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function encodeField(
if (type === 'bytes') {
if (typeof value === 'number') {
value = numberToBytes(value);
} else if (isStrictHexString(value)) {
} else if (isStrictHexString(value) || value === '0x') {
value = hexToBytes(value);
} else if (typeof value === 'string') {
value = stringToBytes(value);
Expand Down

0 comments on commit aae514f

Please sign in to comment.