@@ -216,6 +216,22 @@ def ver_t(s):
216216 parts = (s .split ('.' ) + ['0' , '0' , '0' ])[:3 ]
217217 return tuple (int ('' .join (ch for ch in p if ch .isdigit ()) or '0' ) for p in parts )
218218def ver_ge (a , b ): return ver_t (a ) >= ver_t (b )
219+
220+ # Tests whose newer fail-closed behavior deliberately returns before drawing a
221+ # confirmation screen. Keep their historical catalog text, but do not schedule
222+ # or audit an OLED capture once the refusal behavior is active.
223+ _NO_SCREEN_FROM = {
224+ ('test_msg_signtx_ethereum_erc20' , 'test_approve_all' ): '7.14.2' ,
225+ }
226+
227+
228+ def _screens_for (fw_version , mod , meth , screens ):
229+ floor = _NO_SCREEN_FROM .get ((mod , meth ))
230+ if floor and ver_ge (fw_version , floor ):
231+ return []
232+ return screens
233+
234+
219235def _w (text , n = 95 ):
220236 words , lines , cur = text .split (), [], ''
221237 for w in words :
@@ -1101,7 +1117,8 @@ def _arg_shown(a):
11011117 ['Approval screen' ]),
11021118 ('E11' , 'test_msg_signtx_ethereum_erc20' , 'test_approve_all' ,
11031119 'ERC-20 approve unlimited' ,
1104- 'MAX_UINT256 approval. Device shows "UNLIMITED" warning since this grants infinite spending.' ,
1120+ 'MAX_UINT256 approval. Older firmware showed an "UNLIMITED" warning; 7.14.2 and later '
1121+ 'refuse it before drawing a confirmation screen.' ,
11051122 ['Unlimited approval warning' ]),
11061123 ('E12' , 'test_msg_ethereum_makerdao' , 'test_generate' ,
11071124 'MakerDAO generate DAI' , 'Complex DeFi contract interaction (MakerDAO CDP).' , []),
@@ -3101,6 +3118,7 @@ def _section_state(s):
31013118 pb .text (9 , f'Tests: { len (tests )} ' , bold = True )
31023119 pb .gap (2 )
31033120 for tid , mod , meth , title , ctx , scr in tests :
3121+ scr = _screens_for (fw_version , mod , meth , scr )
31043122 pb .need (50 )
31053123 r = _lookup (results , mod , meth )
31063124 pb .check (9 , f'{ tid } { meth } ' , r )
@@ -3216,7 +3234,7 @@ def screenshot_filter(fw_version):
32163234 terms = []
32173235 for letter , title , mf , bg , fl , tests in active :
32183236 for tid , mod , meth , ttl , ctx , scr in tests :
3219- if scr : # non-empty screenshot list = needs OLED capture
3237+ if _screens_for ( fw_version , mod , meth , scr ):
32203238 # Use (method and module) for unambiguous pytest -k matching
32213239 terms .append (f'({ meth } and { mod } )' )
32223240 return ' or ' .join (terms )
@@ -3228,7 +3246,7 @@ def screenshot_test_list(fw_version):
32283246 pairs = set ()
32293247 for _letter , _title , _mf , _bg , _fl , tests in active :
32303248 for _tid , mod , meth , _ttl , _ctx , screens in tests :
3231- if screens :
3249+ if _screens_for ( fw_version , mod , meth , screens ) :
32323250 pairs .add ('%s::%s' % (mod , meth ))
32333251 return '\n ' .join (sorted (pairs ))
32343252
@@ -3291,7 +3309,7 @@ def screenshot_audit(fw_version, screenshot_root, junit_path=None):
32913309 missing = []
32923310 for letter , title , mf , bg , fl , tests in active :
32933311 for tid , mod , meth , ttl , ctx , scr in tests :
3294- if not scr :
3312+ if not _screens_for ( fw_version , mod , meth , scr ) :
32953313 continue
32963314 if (mod , meth ) in skipped :
32973315 continue
0 commit comments