@@ -145,14 +145,8 @@ impl Application for WalletApp {
145145 } ) ;
146146 }
147147
148- let max_fee = user_op. max_fee ;
149- // Users sign a cap (log-space exponent); sequencer executes against the committed frame fee.
150- if max_fee < current_fee {
151- return Err ( InvalidReason :: InvalidMaxFee {
152- max_fee,
153- base_fee : current_fee,
154- } ) ;
155- }
148+ // max_fee < current_fee is already checked by the trait default in
149+ // validate_and_execute_user_op. No need to repeat here.
156150
157151 let gas_cost = sequencer_core:: fee:: fee_to_linear ( current_fee) ;
158152 let balance = self . balance_of ( & sender) ;
@@ -279,6 +273,8 @@ mod tests {
279273
280274 #[ test]
281275 fn validate_rejects_when_max_fee_below_current_fee ( ) {
276+ use sequencer_core:: application:: { Application , ExecutionOutcome } ;
277+
282278 let mut app = WalletApp :: new ( WalletConfig :: default ( ) ) ;
283279 let sender = Address :: from_slice ( & [ 0x11 ; 20 ] ) ;
284280 app. balances . insert ( sender, U256 :: from ( 10_u64 ) ) ;
@@ -289,15 +285,17 @@ mod tests {
289285 data : Vec :: < u8 > :: new ( ) . into ( ) ,
290286 } ;
291287
292- let err = app
293- . validate_user_op ( sender, & user_op, 2 )
294- . expect_err ( "max_fee < current_fee should be invalid" ) ;
288+ // The max_fee < current_fee check now lives in the trait default
289+ // (validate_and_execute_user_op), not in validate_user_op directly.
290+ let result = app
291+ . validate_and_execute_user_op ( sender, & user_op, 2 )
292+ . expect ( "should return Ok(Invalid), not Err" ) ;
295293 assert_eq ! (
296- err ,
297- InvalidReason :: InvalidMaxFee {
294+ result ,
295+ ExecutionOutcome :: Invalid ( InvalidReason :: InvalidMaxFee {
298296 max_fee: 1 ,
299297 base_fee: 2
300- }
298+ } )
301299 ) ;
302300 }
303301
0 commit comments