chore(tests,ethereum): multiple tokens decoding
What changed, and why it matters
This commit only adds a new automated test case for Ethereum token decoding. It does not change any production code, fix any bug, or alter device behavior. There is no security relevance.
No action required; this is a routine test-only commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a unit test in core/tests/test_apps.ethereum.definitions.py verifying that the Ethereum Definitions class can decode and return multiple tokens for the same chain. It constructs two tokens (token_a and token_b), feeds them to Definitions.from_encoded, and asserts both are retrievable by address. No implementation code is modified.
Changed components
core/tests/test_apps.ethereum.definitions.pyInspect captured patch +11 / −0
diff --git a/core/tests/test_apps.ethereum.definitions.py b/core/tests/test_apps.ethereum.definitions.py
index a73d73bb..965ad689 100644
--- a/core/tests/test_apps.ethereum.definitions.py
+++ b/core/tests/test_apps.ethereum.definitions.py
@@ -80,6 +80,17 @@ class TestEthereumDefinitions(unittest.TestCase):
self.assertKnown(defs.network)
self.assertEqual(defs.get_token(b"\x00" * 20), token)
+ token_a = make_eth_token(chain_id=42, address=b"\xaa" * 20)
+ token_b = make_eth_token(chain_id=42, address=b"\xbb" * 20)
+ defs = Definitions.from_encoded(
+ encode_eth_network(network),
+ [encode_eth_token(token_a), encode_eth_token(token_b)],
+ chain_id=42,
+ )
+ self.assertEqual(defs.network, network)
+ self.assertEqual(defs.get_token(b"\xaa" * 20), token_a)
+ self.assertEqual(defs.get_token(b"\xbb" * 20), token_b)
+
def test_external_token_mismatch(self) -> None:
network = make_eth_network(chain_id=42)
token = make_eth_token(chain_id=43, address=b"\x00" * 20)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.