-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly encode structs without members
The JSON RPC API specification for 'eth_signTypedData_v4' does not explicitly state that the required struct 'EIP712Domain' has to define any members [1]. The current implementation cannot correctly encode such a structure, as it assumes that at least one member has been parsed and added to the struct's string representation. This commit refactors the struct encoding function such that it now accepts structures that does not define any members. [1] https://eips.ethereum.org/EIPS/eip-712#specification-of-the-eth_signtypeddata-json-rpc
- Loading branch information
1 parent
ac0618c
commit d349a79
Showing
3 changed files
with
25 additions
and
6 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
8 changes: 8 additions & 0 deletions
8
crypto/src/test/resources/structured_data_json_files/ValidMinimalStructuredData.json
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,8 @@ | ||
{ | ||
"types": { | ||
"EIP712Domain": [] | ||
}, | ||
"primaryType": "EIP712Domain", | ||
"domain": {}, | ||
"message": {} | ||
} |