Skip to content

Commit

Permalink
chore: update abitype (#3092)
Browse files Browse the repository at this point in the history
* chore: first commit

* chore: added tests with bigint for chainId domain

* chore: added changeset file

* Delete .changeset/tidy-mice-switch.md

---------

Co-authored-by: jxom <[email protected]>
  • Loading branch information
freemanzMrojo and jxom authored Dec 5, 2024
1 parent 3955166 commit dcf4b49
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 9 deletions.
32 changes: 24 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"@noble/hashes": "1.6.1",
"@scure/bip32": "1.6.0",
"@scure/bip39": "1.5.0",
"abitype": "1.0.6",
"abitype": "1.0.7",
"isows": "1.0.6",
"ox": "0.1.2",
"webauthn-p256": "0.0.10",
Expand Down
15 changes: 15 additions & 0 deletions src/utils/signature/hashTypedData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ test('domain: empty name', () => {
)
})

test('domain: bigint value for chainId', () => {
expect(
hashTypedData({
...typedData.complex,
domain: {
chainId:
14018334920824264832118464179726739019961432051877733167310318607178n,
},
primaryType: 'Mail',
}),
).toMatchInlineSnapshot(
'"0x14ed1dbbfecbe5de3919f7ea47daafdf3a29dfbb60dd88d85509f79773d503a5"',
)
})

test('minimal valid typed message', () => {
const hash = hashTypedData({
types: {
Expand Down

0 comments on commit dcf4b49

Please sign in to comment.