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 Sep 12, 2024
1 parent 39af58f commit a3eb0c6
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 a3eb0c6

Please sign in to comment.