Skip to content

Commit f94bb7b

Browse files
Add call_should_succeed_with_priority_equal_to_max_fee test
1 parent 8e589ee commit f94bb7b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

frame/evm-balances/src/tests.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,27 @@ fn call_should_fail_with_priority_greater_than_max_fee() {
173173
assert_eq!(result.unwrap_err().weight, Weight::from_ref_time(7));
174174
});
175175
}
176+
177+
#[test]
178+
fn call_should_succeed_with_priority_equal_to_max_fee() {
179+
new_test_ext().execute_with(|| {
180+
let tip: u128 = 1_000_000_000;
181+
// Mimics the input for pre-eip-1559 transaction types where `gas_price`
182+
// is used for both `max_fee_per_gas` and `max_priority_fee_per_gas`.
183+
let result = <Test as pallet_evm::Config>::Runner::call(
184+
alice(),
185+
bob(),
186+
Vec::new(),
187+
U256::from(1),
188+
1000000,
189+
Some(U256::from(1_000_000_000)),
190+
Some(U256::from(tip)),
191+
None,
192+
Vec::new(),
193+
true,
194+
true,
195+
<Test as pallet_evm::Config>::config(),
196+
);
197+
assert!(result.is_ok());
198+
});
199+
}

0 commit comments

Comments
 (0)