From ef946a6c87fe85cba6241ace281b2519bd52f2f5 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 18 Jun 2021 12:34:31 +0200 Subject: [PATCH] tests: fix eip1559 tx on non-eip1559 network (#23054) --- tests/state_test_util.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/state_test_util.go b/tests/state_test_util.go index 227ef77cc4..97fd3fb6a8 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -328,6 +328,9 @@ func (tx *stTransaction) toMessage(ps stPostState, baseFee *big.Int) (core.Messa gasPrice = math.BigMin(new(big.Int).Add(tx.MaxPriorityFeePerGas, baseFee), tx.MaxFeePerGas) } + if gasPrice == nil { + return nil, fmt.Errorf("no gas price provided") + } msg := types.NewMessage(from, to, tx.Nonce, value, gasLimit, gasPrice, tx.MaxFeePerGas, tx.MaxPriorityFeePerGas, data, accessList, true)