Skip to content

Commit

Permalink
tests: fix eip1559 tx on non-eip1559 network (ethereum#23054)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Sep 22, 2024
1 parent 0d2d8ce commit 3ff34ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/state_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package tests
import (
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"math/big"
"strings"
Expand Down Expand Up @@ -277,6 +278,9 @@ func (tx *stTransaction) toMessage(ps stPostState, number *big.Int, baseFee *big
gasPrice = math.BigMin(new(big.Int).Add(tx.MaxPriorityFeePerGas, baseFee),
tx.MaxFeePerGas)
}
if gasPrice == nil {
return nil, errors.New("no gas price provided")
}

msg := types.NewMessage(from, to, tx.Nonce, value, gasLimit, tx.GasPrice, tx.MaxFeePerGas, tx.MaxPriorityFeePerGas, data, accessList, true, nil, number)
return msg, nil
Expand Down

0 comments on commit 3ff34ee

Please sign in to comment.