Skip to content

Commit 57c252e

Browse files
Spartymrx
andauthored
accounts/abi/bin/backends: return basefee in suggestGasPrice (#23838)
Co-authored-by: mrx <[email protected]>
1 parent 410e731 commit 57c252e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

accounts/abi/bind/backends/simulated.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func (b *SimulatedBackend) PendingNonceAt(ctx context.Context, account common.Ad
462462
// SuggestGasPrice implements ContractTransactor.SuggestGasPrice. Since the simulated
463463
// chain doesn't have miners, we just return a gas price of 1 for any call.
464464
func (b *SimulatedBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error) {
465-
return big.NewInt(1), nil
465+
return b.pendingBlock.Header().BaseFee, nil
466466
}
467467

468468
// SuggestGasTipCap implements ContractTransactor.SuggestGasTipCap. Since the simulated

accounts/abi/bind/backends/simulated_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ func TestSuggestGasPrice(t *testing.T) {
916916
if err != nil {
917917
t.Errorf("could not get gas price: %v", err)
918918
}
919-
if gasPrice.Uint64() != uint64(1) {
920-
t.Errorf("gas price was not expected value of 1. actual: %v", gasPrice.Uint64())
919+
if gasPrice.Uint64() != sim.pendingBlock.Header().BaseFee.Uint64() {
920+
t.Errorf("gas price was not expected value of %v. actual: %v", sim.pendingBlock.Header().BaseFee.Uint64(), gasPrice.Uint64())
921921
}
922922
}
923923

0 commit comments

Comments
 (0)