Skip to content

Commit

Permalink
refactor: use literals for 00 zero bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Dec 13, 2023
1 parent 808f1b3 commit 604ec9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ const encodeDataSourceWithHash = (
verification?.method || UNKNOWN_VERIFICATION_METHOD,
);
return [
padLeft(0, 4),
'0x0000',
stripHexPrefix(
verificationMethod
? padLeft(keccak256(verificationMethod.name).slice(0, 10), 8)
: padLeft(0, 8),
: '00000000',
),
stripHexPrefix(
verification?.data
? padLeft(verification.data.slice(2).length / 2, 4)
: padLeft(0, 4),
: '0000',
),
stripHexPrefix(
verification?.data ? stripHexPrefix(verification?.data) : '',
Expand Down

0 comments on commit 604ec9b

Please sign in to comment.