@@ -1012,15 +1012,26 @@ def test_binding_happy_path_signs_and_recovers(self):
10121012 def _clearsign_flow (self , flow , chain_id = 1 ):
10131013 """Run one catalog flow END-TO-END with AdvancedMode ON: real tx,
10141014 per-tx-bound metadata, who/what/why annotation plus the ordinary raw
1015- review (auto-acked), sign, and assert the signature recovers to the
1016- device signer over this exact digest ."""
1015+ review (auto-acked), then either sign and recover the exact digest or
1016+ assert the release policy's explicit fail-closed rejection ."""
10171017 n = parse_path (DEVICE_PATH )
10181018 tx_hash = flow_tx_hash (flow , chain_id )
10191019 resp = self .client .ethereum_send_tx_metadata (
10201020 signed_payload = flow_blob (flow , chain_id ),
10211021 metadata_version = 1 , key_id = TEST_KEY_ID )
10221022 self .assertEqual (resp .classification , CLASSIFICATION_VERIFIED )
10231023
1024+ if flow ['key' ] == 'erc20-approve-unlimited' :
1025+ with self .assertRaises (CallException ) as ctx :
1026+ self .client .ethereum_sign_tx (
1027+ n = n , nonce = FLOW_NONCE , gas_price = FLOW_GAS_PRICE ,
1028+ gas_limit = FLOW_GAS_LIMIT , to = flow ['to' ],
1029+ value = flow ['value' ], data = flow ['data' ],
1030+ chain_id = chain_id )
1031+ self .assertIn ('Unlimited ERC20 approval is disabled' ,
1032+ str (ctx .exception ))
1033+ return
1034+
10241035 sig_v , sig_r , sig_s = self .client .ethereum_sign_tx (
10251036 n = n , nonce = FLOW_NONCE , gas_price = FLOW_GAS_PRICE ,
10261037 gas_limit = FLOW_GAS_LIMIT , to = flow ['to' ], value = flow ['value' ],
0 commit comments