File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
tests/berlin/eip2930_access_list Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -156,14 +156,29 @@ def test_tx_intrinsic_gas(
156156 intrinsic_gas_cost_calculator = fork .transaction_intrinsic_cost_calculator ()
157157 intrinsic_gas_cost = intrinsic_gas_cost_calculator (calldata = data , access_list = access_list )
158158
159+ exception : List [TransactionException ] | TransactionException | None = None
160+ if below_intrinsic :
161+ data_floor_gas_cost_calculator = fork .transaction_data_floor_cost_calculator ()
162+ data_floor_gas_cost = data_floor_gas_cost_calculator (data = data )
163+ if data_floor_gas_cost > intrinsic_gas_cost :
164+ exception = TransactionException .INTRINSIC_GAS_BELOW_FLOOR_GAS_COST
165+ elif data_floor_gas_cost == intrinsic_gas_cost :
166+ # Depending on the implementation, client might raise either exception.
167+ exception = [
168+ TransactionException .INTRINSIC_GAS_TOO_LOW ,
169+ TransactionException .INTRINSIC_GAS_BELOW_FLOOR_GAS_COST ,
170+ ]
171+ else :
172+ exception = TransactionException .INTRINSIC_GAS_TOO_LOW
173+
159174 tx = Transaction (
160175 ty = tx_type ,
161176 sender = pre .fund_eoa (),
162177 to = pre .deploy_contract (code = Op .SSTORE (0 , Op .ADD (1 , 1 ))),
163178 data = data ,
164179 access_list = access_list ,
165180 gas_limit = intrinsic_gas_cost + (- 1 if below_intrinsic else 0 ),
166- error = TransactionException . INTRINSIC_GAS_TOO_LOW if below_intrinsic else None ,
181+ error = exception ,
167182 protected = True ,
168183 )
169184
You can’t perform that action at this time.
0 commit comments