@@ -132,6 +132,7 @@ func TestStateProcessorErrors(t *testing.T) {
132
132
bigNumber := new (big.Int ).SetBytes (common .MaxHash .Bytes ())
133
133
tooBigNumber := new (big.Int ).Set (bigNumber )
134
134
tooBigNumber .Add (tooBigNumber , common .Big1 )
135
+ gasLimit := blockchain .CurrentHeader ().GasLimit
135
136
for i , tt := range []struct {
136
137
txs []* types.Transaction
137
138
want string
@@ -157,9 +158,9 @@ func TestStateProcessorErrors(t *testing.T) {
157
158
},
158
159
{ // ErrGasLimitReached
159
160
txs : []* types.Transaction {
160
- makeTx (key1 , 0 , common.Address {}, big .NewInt (0 ), 21000000 , big .NewInt (875000000 ), nil ),
161
+ makeTx (key1 , 0 , common.Address {}, big .NewInt (0 ), gasLimit + 1 , big .NewInt (875000000 ), nil ),
161
162
},
162
- want : "could not apply tx 0 [0xbd49d8dadfd47fb846986695f7d4da3f7b2c48c8da82dbc211a26eb124883de9 ]: gas limit reached" ,
163
+ want : "could not apply tx 0 [0xd0fb3ea181e800cd55c4637c55c1f2f78137efb6bb9723e50bda3cad97208db2 ]: gas limit reached" ,
163
164
},
164
165
{ // ErrInsufficientFundsForTransfer
165
166
txs : []* types.Transaction {
@@ -185,9 +186,9 @@ func TestStateProcessorErrors(t *testing.T) {
185
186
},
186
187
{ // ErrGasLimitReached
187
188
txs : []* types.Transaction {
188
- makeTx (key1 , 0 , common.Address {}, big .NewInt (0 ), params . TxGas * 1000 , big .NewInt (875000000 ), nil ),
189
+ makeTx (key1 , 0 , common.Address {}, big .NewInt (0 ), gasLimit + 1 , big .NewInt (875000000 ), nil ),
189
190
},
190
- want : "could not apply tx 0 [0xbd49d8dadfd47fb846986695f7d4da3f7b2c48c8da82dbc211a26eb124883de9 ]: gas limit reached" ,
191
+ want : "could not apply tx 0 [0xd0fb3ea181e800cd55c4637c55c1f2f78137efb6bb9723e50bda3cad97208db2 ]: gas limit reached" ,
191
192
},
192
193
{ // ErrFeeCapTooLow
193
194
txs : []* types.Transaction {
@@ -256,6 +257,12 @@ func TestStateProcessorErrors(t *testing.T) {
256
257
},
257
258
// ErrSetCodeTxCreate cannot be tested here: it is impossible to create a SetCode-tx with nil `to`.
258
259
// The EstimateGas API tests test this case.
260
+ { // ErrGasLimitTooHigh
261
+ txs : []* types.Transaction {
262
+ makeTx (key1 , 0 , common.Address {}, big .NewInt (0 ), params .MaxTxGas + 1 , big .NewInt (875000000 ), nil ),
263
+ },
264
+ want : "could not apply tx 0 [0x16505812a6da0b0150593e4d4eb90190ba64816a04b27d19ca926ebd6aff8aa0]: transaction gas limit too high (cap: 16777216, tx: 16777217)" ,
265
+ },
259
266
} {
260
267
block := GenerateBadBlock (gspec .ToBlock (), beacon .New (ethash .NewFaker ()), tt .txs , gspec .Config , false )
261
268
_ , err := blockchain .InsertChain (types.Blocks {block })
0 commit comments