-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for more starknet signature format (#1040)
* chore: add tests * fix: add support for validating signatures with `v` element * chore: update test fixtures * fix: app support for [rsv] signature * fix: throw meaningful error when starknet contract is not deployed * fix: validate result before returning * fix: reject with a meaningful error on invalid signature format * fix: default to return false * Revert "fix: default to return false" This reverts commit 0211641. * fix: improve error message * chore: add more tests * fix: fix function not available on lower node version * v0.12.2 --------- Co-authored-by: Chaitanya <[email protected]>
- Loading branch information
Showing
4 changed files
with
141 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"address": "0x008cf64fc19a22c94c4d751ebd39ff897dbe2c8646b2900d646558e293b0a2e5", | ||
"sig": [ | ||
"0x1", | ||
"0xa0f72077d0b928be15ddfc21c481af27a9c79d7b67e049bb97a9919cb9218e", | ||
"0x895bcbd404d7374850219753d98a397c962985ffa3f36d5bd06aab41a01709" | ||
], | ||
"data": { | ||
"domain": { | ||
"name": "sx-starknet", | ||
"version": "0.1.0", | ||
"chainId": "0x534e5f4d41494e", | ||
"verifyingContract": "" | ||
}, | ||
"types": { | ||
"StarkNetDomain": [ | ||
{ | ||
"name": "name", | ||
"type": "felt252" | ||
}, | ||
{ | ||
"name": "version", | ||
"type": "felt252" | ||
}, | ||
{ | ||
"name": "chainId", | ||
"type": "felt252" | ||
}, | ||
{ | ||
"name": "verifyingContract", | ||
"type": "ContractAddress" | ||
} | ||
], | ||
"SetAlias": [ | ||
{ | ||
"name": "from", | ||
"type": "ContractAddress" | ||
}, | ||
{ | ||
"name": "alias", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "timestamp", | ||
"type": "felt" | ||
} | ||
] | ||
}, | ||
"message": { | ||
"from": "0x008cf64fc19a22c94c4d751ebd39ff897dbe2c8646b2900d646558e293b0a2e5", | ||
"timestamp": 1721836843, | ||
"alias": "0x6ceddb030f3ef6dBD04B8b3691CaB101ECe226f6" | ||
}, | ||
"primaryType": "SetAlias" | ||
} | ||
} |