Skip to content

Commit 6e42506

Browse files
Updated GCS Ragger test for sender address trusted name
1 parent 8d4fdb8 commit 6e42506

File tree

7 files changed

+25
-18
lines changed

7 files changed

+25
-18
lines changed
856 Bytes
Loading
-342 Bytes
Loading
371 Bytes
Loading
-342 Bytes
Loading
371 Bytes
Loading
682 Bytes
Loading

tests/ragger/test_gcs.py

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ def test_gcs_nft(firmware: Firmware,
4040
abi=json.load(file),
4141
address=None
4242
)
43-
recipient_addr = bytes.fromhex("1111111111111111111111111111111111111111")
43+
with app_client.get_public_addr(bip32_path="m/44'/60'/0'/0/0", display=False):
44+
pass
45+
_, device_addr, _ = ResponseParser.pk_addr(app_client.response().data)
4446
data = contract.encode_abi("safeBatchTransferFrom", [
45-
bytes.fromhex("Dad77910DbDFdE764fC21FCD4E74D71bBACA6D8D"),
46-
recipient_addr,
47+
bytes.fromhex("1111111111111111111111111111111111111111"),
48+
bytes.fromhex("d8da6bf26964af9d7eed9e03e53415d37aa96045"),
4749
[
4850
0xff,
4951
0xffff,
@@ -75,8 +77,8 @@ def test_gcs_nft(firmware: Firmware,
7577
Field(
7678
1,
7779
"From",
78-
ParamType.RAW,
79-
ParamRaw(
80+
ParamType.TRUSTED_NAME,
81+
ParamTrustedName(
8082
1,
8183
Value(
8284
1,
@@ -88,14 +90,27 @@ def test_gcs_nft(firmware: Firmware,
8890
PathLeaf(PathLeafType.STATIC),
8991
]
9092
),
91-
)
93+
),
94+
[
95+
TrustedNameType.ACCOUNT,
96+
],
97+
[
98+
TrustedNameSource.UD,
99+
TrustedNameSource.ENS,
100+
TrustedNameSource.FN,
101+
],
102+
[
103+
bytes.fromhex("0000000000000000000000000000000000000000"),
104+
bytes.fromhex("1111111111111111111111111111111111111111"),
105+
bytes.fromhex("2222222222222222222222222222222222222222"),
106+
],
92107
)
93108
),
94109
Field(
95110
1,
96111
"To",
97-
ParamType.TRUSTED_NAME,
98-
ParamTrustedName(
112+
ParamType.RAW,
113+
ParamRaw(
99114
1,
100115
Value(
101116
1,
@@ -107,15 +122,7 @@ def test_gcs_nft(firmware: Firmware,
107122
PathLeaf(PathLeafType.STATIC),
108123
]
109124
),
110-
),
111-
[
112-
TrustedNameType.ACCOUNT,
113-
],
114-
[
115-
TrustedNameSource.UD,
116-
TrustedNameSource.ENS,
117-
TrustedNameSource.FN,
118-
],
125+
)
119126
)
120127
),
121128
Field(
@@ -205,7 +212,7 @@ def test_gcs_nft(firmware: Firmware,
205212

206213
app_client.provide_transaction_info(tx_info.serialize())
207214
challenge = ResponseParser.challenge(app_client.get_challenge().data)
208-
app_client.provide_trusted_name_v2(recipient_addr,
215+
app_client.provide_trusted_name_v2(device_addr,
209216
"gerard.eth",
210217
TrustedNameType.ACCOUNT,
211218
TrustedNameSource.ENS,

0 commit comments

Comments
 (0)