From 95a825e9c6d217622fb32806b3f47cd6ed096231 Mon Sep 17 00:00:00 2001 From: Sparty Date: Mon, 1 Nov 2021 02:49:45 -0400 Subject: [PATCH] accounts/abi/bin/backends: return basefee in suggestGasPrice (#23838) Co-authored-by: mrx --- accounts/abi/bind/backends/simulated_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/accounts/abi/bind/backends/simulated_test.go b/accounts/abi/bind/backends/simulated_test.go index 9fe0577364a96..2432f11a398cb 100644 --- a/accounts/abi/bind/backends/simulated_test.go +++ b/accounts/abi/bind/backends/simulated_test.go @@ -883,8 +883,12 @@ 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()) + baseFee := sim.pendingBlock.Header().BaseFee + if baseFee == nil { + baseFee = big.NewInt(1) + } + if gasPrice.Uint64() != baseFee.Uint64() { + t.Errorf("gas price was not expected value of %v. actual: %v", sim.pendingBlock.Header().BaseFee.Uint64(), gasPrice.Uint64()) } }