What changed, and why it matters
This commit only removes an unused parameter called `is_dynamic` from test helper functions and from test data in three test files. It does not change any production firmware code, wallet behavior, or security logic. It is a cleanup of the test suite with no user-facing or security impact.
No action required; this is a test-only refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change deletes the is_dynamic argument from a test-only helper p_tuple() and from all call sites in Ethereum clear-signing unit and device tests. The commit message and diff comments confirm the field was already ignored by the implementation; dynamism is derived from the tuple’s fields. No runtime code, protobuf definitions, or cryptographic paths are modified.
Changed components
core/tests/test_apps.ethereum.clear_signing.pytests/device_tests/ethereum/test_definitions.pytests/device_tests/ethereum/test_definitions_request.pyInspect captured patch +6 / −32
### core/tests/test_apps.ethereum.clear_signing.py
@@ -94,12 +94,8 @@ def p_dynamic(abi_type: "EthereumABIType") -> "EthereumABIValueInfo":
return EthereumABIValueInfo(dynamic=abi_type)
-def p_tuple(
- fields: "list[EthereumABIValueInfo]", is_dynamic: bool
-) -> "EthereumABIValueInfo":
- return EthereumABIValueInfo(
- tuple=EthereumABITupleInfo(fields=fields, is_dynamic=is_dynamic)
- )
+def p_tuple(fields: "list[EthereumABIValueInfo]") -> "EthereumABIValueInfo":
+ return EthereumABIValueInfo(tuple=EthereumABITupleInfo(fields=fields))
def p_array(element: "EthereumABIValueInfo") -> "EthereumABIValueInfo":
@@ -1824,7 +1820,6 @@ def test_static_tuple(self):
node = ABIValue.from_proto(
p_tuple(
[p_atomic(EABIT.ABI_ADDRESS), p_atomic(EABIT.ABI_UINT256)],
- is_dynamic=False,
)
)
@@ -1845,7 +1840,6 @@ def test_dynamic_tuple(self):
node = ABIValue.from_proto(
p_tuple(
[p_atomic(EABIT.ABI_ADDRESS), p_dynamic(EABIT.ABI_BYTES)],
- is_dynamic=True,
)
)
@@ -1928,7 +1922,6 @@ def test_array_of_static_tuples(self):
p_array(
p_tuple(
[p_atomic(EABIT.ABI_ADDRESS), p_atomic(EABIT.ABI_UINT256)],
- is_dynamic=False,
)
)
)
@@ -1947,14 +1940,10 @@ def test_array_of_static_tuples(self):
self.assertEqual(consumed, 32)
def test_array_of_dynamic_tuples(self):
- # The wire descriptor's `is_dynamic` is already ignored in this
- # position - the flag is derived from the fields instead - so pass the
- # value the generator actually emits here (False) to pin that.
node = ABIValue.from_proto(
p_array(
p_tuple(
[p_atomic(EABIT.ABI_ADDRESS), p_dynamic(EABIT.ABI_STRING)],
- is_dynamic=False,
)
)
)
@@ -1984,8 +1973,8 @@ def test_array_of_dynamic_tuples(self):
def test_tuple_field_may_be_a_tuple(self):
# ((uint256 b) inner): a struct as a struct member. Both are static,
# so the whole thing is one word encoded in place.
- inner = p_tuple([p_atomic(EABIT.ABI_UINT256)], is_dynamic=False)
- node = ABIValue.from_proto(p_tuple([inner], is_dynamic=False))
+ inner = p_tuple([p_atomic(EABIT.ABI_UINT256)])
+ node = ABIValue.from_proto(p_tuple([inner]))
self.assertFalse(node.is_dynamic)
self.assertEqual(node.head_size, 32)
@@ -2000,7 +1989,7 @@ def test_tuple_field_may_be_an_array(self):
# (uint256[] xs): the array member makes the struct dynamic, and the
# array's own offset is relative to the struct's body start.
inner = p_array(p_atomic(EABIT.ABI_UINT256))
- node = ABIValue.from_proto(p_tuple([inner], is_dynamic=True))
+ node = ABIValue.from_proto(p_tuple([inner]))
self.assertTrue(node.is_dynamic)
self.assertEqual(node.head_size, 32)
@@ -2040,7 +2029,6 @@ def test_serenita_leaf_array_inside_struct(self):
p_atomic(EABIT.ABI_UINT160),
p_array(p_atomic(EABIT.ABI_BYTES32)),
],
- is_dynamic=True,
)
)
@@ -2088,7 +2076,6 @@ def test_kyberswap_struct_in_struct_end_to_end(self):
p_atomic(EABIT.ABI_UINT256), # 9 flags
p_dynamic(EABIT.ABI_BYTES), # 10 permit
],
- is_dynamic=True,
)
execution = p_tuple(
[
@@ -2098,7 +2085,6 @@ def test_kyberswap_struct_in_struct_end_to_end(self):
desc, # 3 desc
p_dynamic(EABIT.ABI_BYTES), # 4 clientData
],
- is_dynamic=True,
)
src_token = bytes.fromhex("a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")
@@ -2193,7 +2179,6 @@ def test_okx_dag_swap_array_of_structs_with_leaf_arrays(self):
p_array(p_dynamic(EABIT.ABI_BYTES)),
p_atomic(EABIT.ABI_UINT256),
],
- is_dynamic=True,
)
)
)
@@ -2235,13 +2220,11 @@ def test_flare_array_of_structs_with_nested_struct(self):
p_atomic(EABIT.ABI_UINT120),
p_atomic(EABIT.ABI_UINT8),
],
- is_dynamic=False,
)
node = ABIValue.from_proto(
p_array(
p_tuple(
[p_array(p_atomic(EABIT.ABI_BYTES32)), body],
- is_dynamic=True,
)
)
)
@@ -2279,11 +2262,9 @@ def test_struct_field_may_be_an_array_of_structs(self):
p_atomic(EABIT.ABI_ADDRESS),
p_atomic(EABIT.ABI_UINT256),
],
- is_dynamic=False,
)
),
],
- is_dynamic=True,
)
)
@@ -2326,7 +2307,6 @@ def test_three_nested_arrays_through_tuple_rejected(self):
# them past the cap.
node = p_tuple(
[p_array(p_array(p_array(p_atomic(EABIT.ABI_UINT256))))],
- is_dynamic=True,
)
with self.assertRaises(InvalidFormatDefinition):
ABIValue.from_proto(node)
@@ -2341,7 +2321,6 @@ def test_sibling_arrays_do_not_accumulate(self):
p_array(p_atomic(EABIT.ABI_UINT256)),
p_array(p_atomic(EABIT.ABI_UINT256)),
],
- is_dynamic=True,
)
)
@@ -2369,7 +2348,7 @@ def test_depth_cap_boundary(self):
def nest(n: int) -> "EthereumABIValueInfo":
node = p_atomic(EABIT.ABI_UINT256)
for _ in range(n):
- node = p_tuple([node], is_dynamic=False)
+ node = p_tuple([node])
return node
deepest_accepted = ABIValue.from_proto(nest(8))
@@ -2394,7 +2373,6 @@ def test_okx_smart_swap_shape_rejected(self):
p_array(p_dynamic(EABIT.ABI_BYTES)), # extraData
p_atomic(EABIT.ABI_UINT256), # fromToken
],
- is_dynamic=True,
)
with self.assertRaises(InvalidFormatDefinition):
ABIValue.from_proto(p_array(p_array(element)))
### tests/device_tests/ethereum/test_definitions.py
@@ -417,7 +417,6 @@ def get_clear_signing_sign_tx_eip1559_params(
atomic=messages.EthereumABIType.ABI_UINT160
), # sqrtPriceLimitX96
],
- is_dynamic=False,
)
)
],
@@ -588,7 +587,6 @@ def test_clear_signing_with_mismatched_definition(session: Session) -> None:
# extra field — causes OutOfBounds during clear signing
messages.EthereumABIValueInfo(atomic=messages.EthereumABIType.ABI_UINT256),
],
- is_dynamic=False,
)
bad_display_format = definitions.make_eth_display_format(
chain_id=UNISWAP_EXACT_INPUT_SINGLE_DISPLAY_FORMAT.chain_id,
@@ -742,7 +740,6 @@ def _make_okx_paths_calldata(raw_data_count: int) -> bytes:
atomic=messages.EthereumABIType.ABI_UINT256
), # fromToken
],
- is_dynamic=True,
)
)
)
### tests/device_tests/ethereum/test_definitions_request.py
@@ -216,7 +216,6 @@ def test_definition_request_with_invalid_display_format(session: Session) -> Non
# extra field — causes OutOfBounds during clear signing
messages.EthereumABIValueInfo(atomic=messages.EthereumABIType.ABI_UINT256),
],
- is_dynamic=False,
)
bad_display_format = definitions.make_eth_display_format(
chain_id=UNISWAP_EXACT_INPUT_SINGLE_DISPLAY_FORMAT.chain_id,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.