From d4dcd1c3386c31e6e82a58f97697501d5b462910 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Mon, 15 Jan 2024 19:09:41 +0200 Subject: [PATCH] Fix for faucet. --- tools/faucet/faucet/faucet.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/faucet/faucet/faucet.go b/tools/faucet/faucet/faucet.go index 2da6f4205a..981fd4dd66 100644 --- a/tools/faucet/faucet/faucet.go +++ b/tools/faucet/faucet/faucet.go @@ -117,18 +117,16 @@ func (f *Faucet) fundNativeToken(address *common.Address, amount *big.Int) (*typ // this isn't great as the tx count might be incremented in between calls // but only after removing the pk from other apps can we use a proper counter - // todo remove hardcoded gas values - gas := uint64(21000) - tx := &types.LegacyTx{ Nonce: nonce, GasPrice: big.NewInt(225), - Gas: gas, To: address, Value: amount, } - signedTx, err := f.wallet.SignTransaction(tx) + estimatedTx := f.client.EstimateGasAndGasPrice(tx) + + signedTx, err := f.wallet.SignTransaction(estimatedTx) if err != nil { return nil, err }