accounts/abi/bind/backends: make suggestGasPrice compatible with non-1559 chains (#23840)

pull/22148/head
Marius van der Wijden 3 years ago committed by GitHub
parent 1e4becb5c1
commit c2e64db3b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      accounts/abi/bind/backends/simulated.go

@ -462,7 +462,10 @@ func (b *SimulatedBackend) PendingNonceAt(ctx context.Context, account common.Ad
// SuggestGasPrice implements ContractTransactor.SuggestGasPrice. Since the simulated
// chain doesn't have miners, we just return a gas price of 1 for any call.
func (b *SimulatedBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error) {
return b.pendingBlock.Header().BaseFee, nil
if b.pendingBlock.Header().BaseFee != nil {
return b.pendingBlock.Header().BaseFee, nil
}
return big.NewInt(1), nil
}
// SuggestGasTipCap implements ContractTransactor.SuggestGasTipCap. Since the simulated

Loading…
Cancel
Save