Skip to content

Commit

Permalink
accounts/abi/bind/backends: make suggestGasPrice compatible with non-…
Browse files Browse the repository at this point in the history
…1559 chains (ethereum#23840)
  • Loading branch information
MariusVanDerWijden authored and gzliudan committed Aug 24, 2024
1 parent a188916 commit 09034bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,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
Expand Down

0 comments on commit 09034bd

Please sign in to comment.