accounts/abi/bin/backends: return basefee in suggestGasPrice (#23838)

Co-authored-by: mrx <mrx@mrx.com>
pull/23840/head
Sparty 3 years ago committed by GitHub
parent 410e731bea
commit 57c252ef4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      accounts/abi/bind/backends/simulated.go
  2. 4
      accounts/abi/bind/backends/simulated_test.go

@ -462,7 +462,7 @@ 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 big.NewInt(1), nil
return b.pendingBlock.Header().BaseFee, nil
}
// SuggestGasTipCap implements ContractTransactor.SuggestGasTipCap. Since the simulated

@ -916,8 +916,8 @@ func TestSuggestGasPrice(t *testing.T) {
if err != nil {
t.Errorf("could not get gas price: %v", err)
}
if gasPrice.Uint64() != uint64(1) {
t.Errorf("gas price was not expected value of 1. actual: %v", gasPrice.Uint64())
if gasPrice.Uint64() != sim.pendingBlock.Header().BaseFee.Uint64() {
t.Errorf("gas price was not expected value of %v. actual: %v", sim.pendingBlock.Header().BaseFee.Uint64(), gasPrice.Uint64())
}
}

Loading…
Cancel
Save