diff --git a/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00000.png b/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00000.png new file mode 100644 index 0000000..ea9d875 Binary files /dev/null and b/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00000.png differ diff --git a/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00001.png b/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00001.png new file mode 100644 index 0000000..51495af Binary files /dev/null and b/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00001.png differ diff --git a/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00002.png b/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00002.png new file mode 100644 index 0000000..cb969d2 Binary files /dev/null and b/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00002.png differ diff --git a/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00003.png b/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00003.png new file mode 100644 index 0000000..8b981d4 Binary files /dev/null and b/tests/ragger/snapshots/flex/test_eip712_advanced_filtering_unlimited/00003.png differ diff --git a/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00000.png b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00000.png new file mode 100644 index 0000000..b546f65 Binary files /dev/null and b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00000.png differ diff --git a/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00001.png b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00001.png new file mode 100644 index 0000000..6225fd9 Binary files /dev/null and b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00001.png differ diff --git a/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00002.png b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00002.png new file mode 100644 index 0000000..14b865a Binary files /dev/null and b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00002.png differ diff --git a/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00003.png b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00003.png new file mode 100644 index 0000000..5ec054f Binary files /dev/null and b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00003.png differ diff --git a/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00004.png b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00004.png new file mode 100644 index 0000000..53ae651 Binary files /dev/null and b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00004.png differ diff --git a/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00005.png b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00005.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/ragger/snapshots/nanosp/test_eip712_advanced_filtering_unlimited/00005.png differ diff --git a/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00000.png b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00000.png new file mode 100644 index 0000000..b546f65 Binary files /dev/null and b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00000.png differ diff --git a/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00001.png b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00001.png new file mode 100644 index 0000000..6225fd9 Binary files /dev/null and b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00001.png differ diff --git a/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00002.png b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00002.png new file mode 100644 index 0000000..14b865a Binary files /dev/null and b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00002.png differ diff --git a/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00003.png b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00003.png new file mode 100644 index 0000000..5ec054f Binary files /dev/null and b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00003.png differ diff --git a/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00004.png b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00004.png new file mode 100644 index 0000000..53ae651 Binary files /dev/null and b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00004.png differ diff --git a/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00005.png b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00005.png new file mode 100644 index 0000000..6578872 Binary files /dev/null and b/tests/ragger/snapshots/nanox/test_eip712_advanced_filtering_unlimited/00005.png differ diff --git a/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00000.png b/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00000.png new file mode 100644 index 0000000..b47dc20 Binary files /dev/null and b/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00000.png differ diff --git a/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00001.png b/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00001.png new file mode 100644 index 0000000..62cd3fb Binary files /dev/null and b/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00001.png differ diff --git a/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00002.png b/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00002.png new file mode 100644 index 0000000..9c2fa5d Binary files /dev/null and b/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00002.png differ diff --git a/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00003.png b/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00003.png new file mode 100644 index 0000000..54aba60 Binary files /dev/null and b/tests/ragger/snapshots/stax/test_eip712_advanced_filtering_unlimited/00003.png differ diff --git a/tests/ragger/test_eip712.py b/tests/ragger/test_eip712.py index ce7b798..79953bd 100644 --- a/tests/ragger/test_eip712.py +++ b/tests/ragger/test_eip712.py @@ -4,8 +4,10 @@ from functools import partial from pathlib import Path import json from typing import Optional +from ctypes import c_uint64 import pytest from eth_account.messages import encode_typed_data +import web3 from ragger.backend import BackendInterface from ragger.firmware import Firmware @@ -298,7 +300,7 @@ ADVANCED_DATA_SETS = [ "chainId": 1, }, "message": { - "owner": "0xb5a6948372defdfc5754b69dc831d21e2d5ebd74", + "owner": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "spender": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "value": 4200000000000000000, "nonce": 0, @@ -328,6 +330,69 @@ ADVANCED_DATA_SETS = [ }, "_permit" ), + DataSet( + { + "types": { + "EIP712Domain": [ + {"name": "name", "type": "string"}, + {"name": "version", "type": "string"}, + {"name": "chainId", "type": "uint256"}, + {"name": "verifyingContract", "type": "address"}, + ], + "Root": [ + {"name": "token_big", "type": "address"}, + {"name": "value_big", "type": "uint256"}, + {"name": "token_biggest", "type": "address"}, + {"name": "value_biggest", "type": "uint256"}, + ] + }, + "primaryType": "Root", + "domain": { + "name": "test", + "version": "1", + "verifyingContract": "0x0000000000000000000000000000000000000000", + "chainId": 1, + }, + "message": { + "token_big": "0x6b175474e89094c44da98b954eedeac495271d0f", + "value_big": c_uint64(-1).value, + "token_biggest": "0x6b175474e89094c44da98b954eedeac495271d0f", + "value_biggest": int(web3.constants.MAX_INT, 0), + } + }, + { + "name": "Unlimited test", + "tokens": [ + { + "addr": "0x6b175474e89094c44da98b954eedeac495271d0f", + "ticker": "DAI", + "decimals": 18, + "chain_id": 1, + }, + ], + "fields": { + "token_big": { + "type": "amount_join_token", + "token": 0, + }, + "value_big": { + "type": "amount_join_value", + "name": "Big", + "token": 0, + }, + "token_biggest": { + "type": "amount_join_token", + "token": 0, + }, + "value_biggest": { + "type": "amount_join_value", + "name": "Biggest", + "token": 0, + }, + } + }, + "_unlimited" + ), ]