@@ -132,6 +132,7 @@ func TestStateProcessorErrors(t *testing.T) {
132132 bigNumber := new (big.Int ).SetBytes (common .MaxHash .Bytes ())
133133 tooBigNumber := new (big.Int ).Set (bigNumber )
134134 tooBigNumber .Add (tooBigNumber , common .Big1 )
135+ gasLimit := blockchain .CurrentHeader ().GasLimit
135136 for i , tt := range []struct {
136137 txs []* types.Transaction
137138 want string
@@ -157,9 +158,9 @@ func TestStateProcessorErrors(t *testing.T) {
157158 },
158159 { // ErrGasLimitReached
159160 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 ),
161162 },
162- want : "could not apply tx 0 [0xbd49d8dadfd47fb846986695f7d4da3f7b2c48c8da82dbc211a26eb124883de9 ]: gas limit reached" ,
163+ want : "could not apply tx 0 [0xd0fb3ea181e800cd55c4637c55c1f2f78137efb6bb9723e50bda3cad97208db2 ]: gas limit reached" ,
163164 },
164165 { // ErrInsufficientFundsForTransfer
165166 txs : []* types.Transaction {
@@ -185,9 +186,9 @@ func TestStateProcessorErrors(t *testing.T) {
185186 },
186187 { // ErrGasLimitReached
187188 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 ),
189190 },
190- want : "could not apply tx 0 [0xbd49d8dadfd47fb846986695f7d4da3f7b2c48c8da82dbc211a26eb124883de9 ]: gas limit reached" ,
191+ want : "could not apply tx 0 [0xd0fb3ea181e800cd55c4637c55c1f2f78137efb6bb9723e50bda3cad97208db2 ]: gas limit reached" ,
191192 },
192193 { // ErrFeeCapTooLow
193194 txs : []* types.Transaction {
@@ -256,6 +257,12 @@ func TestStateProcessorErrors(t *testing.T) {
256257 },
257258 // ErrSetCodeTxCreate cannot be tested here: it is impossible to create a SetCode-tx with nil `to`.
258259 // 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+ },
259266 } {
260267 block := GenerateBadBlock (gspec .ToBlock (), beacon .New (ethash .NewFaker ()), tt .txs , gspec .Config , false )
261268 _ , err := blockchain .InsertChain (types.Blocks {block })
0 commit comments