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 19, 2024
1 parent 80620bb commit 1227634
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 @@ -276,6 +277,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 1227634

Please sign in to comment.