chore(tests,ethereum): include token payload cases
What changed, and why it matters
This commit only adds a new test helper and one extra test case for Ethereum token payloads in the device's test suite. It does not change any firmware, wallet, or production code. There is no indication this fixes or introduces a security issue.
No security action required. Treat as routine test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds _make_token_payload() helper to tests/device_tests/ethereum/test_definitions_bad.py and includes it in the _cases() list alongside an existing _fails_token failure handler. The change is purely test coverage expansion for malformed/bad Ethereum token definitions. No runtime or firmware code is modified.
Changed components
tests/device_tests/ethereum/test_definitions_bad.pyInspect captured patch +15 / −1
diff --git a/tests/device_tests/ethereum/test_definitions_bad.py b/tests/device_tests/ethereum/test_definitions_bad.py
index 046ef408..9c69d0e7 100644
--- a/tests/device_tests/ethereum/test_definitions_bad.py
+++ b/tests/device_tests/ethereum/test_definitions_bad.py
@@ -60,6 +60,17 @@ def _fails_erc7730_display_format(
)
+def _make_token_payload(
+ timestamp: int = 0xFFFF_FFFF,
+ message: messages.EthereumTokenInfo | bytes = make_eth_token(),
+) -> bytes:
+ return make_payload(
+ data_type=DefinitionType.ETHEREUM_TOKEN,
+ message=message,
+ timestamp=timestamp,
+ )
+
+
def _make_erc7730_payload(
timestamp: int = 0xFFFF_FFFF,
message: messages.EthereumERC7730DisplayFormatInfo | bytes | None = None,
@@ -74,7 +85,10 @@ def _make_erc7730_payload(
def _cases(session: Session) -> list[tuple]:
- cases: list[tuple] = [(make_payload, _fails_network)]
+ cases: list[tuple] = [
+ (make_payload, _fails_network),
+ (_make_token_payload, _fails_token),
+ ]
if session.model in models.CORE_MODELS:
cases.append((_make_erc7730_payload, _fails_erc7730_display_format))
return cases
Why this scored 12/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.