-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use more compact JSON formatter (#121)
backport JSON formatter from LedgerHQ/crypto-assets#1417
- Loading branch information
1 parent
b55fee4
commit 51af91e
Showing
37 changed files
with
1,230 additions
and
2,564 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
102 changes: 30 additions & 72 deletions
102
tests/convert/resolved/data/definition_format_address_name_resolved.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 |
---|---|---|
@@ -1,77 +1,35 @@ | ||
{ | ||
"context": { | ||
"eip712": { | ||
"deployments": [ | ||
{ | ||
"chainId": 1, | ||
"address": "0x0000000000000000000000000000000000000000" | ||
} | ||
"context": { | ||
"eip712": { | ||
"deployments": [{ "chainId": 1, "address": "0x0000000000000000000000000000000000000000" }], | ||
"schemas": [ | ||
{ | ||
"primaryType": "TestPrimaryType", | ||
"types": { | ||
"EIP712Domain": [ | ||
{ "name": "name", "type": "string" }, | ||
{ "name": "chainId", "type": "uint256" }, | ||
{ "name": "verifyingContract", "type": "address" } | ||
], | ||
"schemas": [ | ||
{ | ||
"primaryType": "TestPrimaryType", | ||
"types": { | ||
"EIP712Domain": [ | ||
{ | ||
"name": "name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "chainId", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"name": "verifyingContract", | ||
"type": "address" | ||
} | ||
], | ||
"TestPrimaryType": [ | ||
{ | ||
"name": "param1", | ||
"type": "address" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"metadata": { | ||
"enums": {} | ||
}, | ||
"display": { | ||
"formats": { | ||
"TestPrimaryType": { | ||
"fields": [ | ||
{ | ||
"path": { | ||
"type": "data", | ||
"absolute": true, | ||
"elements": [ | ||
{ | ||
"type": "field", | ||
"identifier": "param1" | ||
} | ||
] | ||
}, | ||
"label": "Param 1", | ||
"format": "addressName", | ||
"params": { | ||
"types": [ | ||
"wallet", | ||
"eoa", | ||
"token", | ||
"contract", | ||
"collection" | ||
], | ||
"sources": [ | ||
"local", | ||
"ens" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
"TestPrimaryType": [{ "name": "param1", "type": "address" }] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"metadata": { "enums": {} }, | ||
"display": { | ||
"formats": { | ||
"TestPrimaryType": { | ||
"fields": [ | ||
{ | ||
"path": { "type": "data", "absolute": true, "elements": [{ "type": "field", "identifier": "param1" }] }, | ||
"label": "Param 1", | ||
"format": "addressName", | ||
"params": { "types": ["wallet", "eoa", "token", "contract", "collection"], "sources": ["local", "ens"] } | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
88 changes: 29 additions & 59 deletions
88
tests/convert/resolved/data/definition_format_amount_resolved.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 |
---|---|---|
@@ -1,64 +1,34 @@ | ||
{ | ||
"context": { | ||
"eip712": { | ||
"deployments": [ | ||
{ | ||
"chainId": 1, | ||
"address": "0x0000000000000000000000000000000000000000" | ||
} | ||
"context": { | ||
"eip712": { | ||
"deployments": [{ "chainId": 1, "address": "0x0000000000000000000000000000000000000000" }], | ||
"schemas": [ | ||
{ | ||
"primaryType": "TestPrimaryType", | ||
"types": { | ||
"EIP712Domain": [ | ||
{ "name": "name", "type": "string" }, | ||
{ "name": "chainId", "type": "uint256" }, | ||
{ "name": "verifyingContract", "type": "address" } | ||
], | ||
"schemas": [ | ||
{ | ||
"primaryType": "TestPrimaryType", | ||
"types": { | ||
"EIP712Domain": [ | ||
{ | ||
"name": "name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "chainId", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"name": "verifyingContract", | ||
"type": "address" | ||
} | ||
], | ||
"TestPrimaryType": [ | ||
{ | ||
"name": "param1", | ||
"type": "uint256" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"metadata": { | ||
"enums": {} | ||
}, | ||
"display": { | ||
"formats": { | ||
"TestPrimaryType": { | ||
"fields": [ | ||
{ | ||
"path": { | ||
"type": "data", | ||
"absolute": true, | ||
"elements": [ | ||
{ | ||
"type": "field", | ||
"identifier": "param1" | ||
} | ||
] | ||
}, | ||
"label": "Param 1", | ||
"format": "amount" | ||
} | ||
] | ||
} | ||
"TestPrimaryType": [{ "name": "param1", "type": "uint256" }] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"metadata": { "enums": {} }, | ||
"display": { | ||
"formats": { | ||
"TestPrimaryType": { | ||
"fields": [ | ||
{ | ||
"path": { "type": "data", "absolute": true, "elements": [{ "type": "field", "identifier": "param1" }] }, | ||
"label": "Param 1", | ||
"format": "amount" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.