tests: fix eip1559 tx on non-eip1559 network (#23054)

This commit is contained in:
Marius van der Wijden 2021-06-18 12:34:31 +02:00 committed by GitHub
parent 58aeab77d2
commit ef946a6c87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)