From 48c863debddbb9d187bc5174e33019b4ea32dc62 Mon Sep 17 00:00:00 2001 From: zeroXbrock <2791467+zeroXbrock@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:23:06 -0700 Subject: [PATCH] build-eth-block: use live gas price --- examples/build-eth-block/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/build-eth-block/main.go b/examples/build-eth-block/main.go index d3bf0b5..e53a5da 100644 --- a/examples/build-eth-block/main.go +++ b/examples/build-eth-block/main.go @@ -23,12 +23,15 @@ func main() { fundBalance := big.NewInt(100000000000000000) maybe(fr.L1.FundAccount(testAddr1.Address(), fundBalance)) + gasPrice, err := fr.L1.RPC().SuggestGasPrice(context.Background()) + maybe(err) + targeAddr := testAddr1.Address() tx, err := fr.L1.SignTx(testAddr1, &types.LegacyTx{ To: &targeAddr, Value: big.NewInt(1000), Gas: 21000, - GasPrice: big.NewInt(6701898710), + GasPrice: gasPrice.Add(gasPrice, big.NewInt(5000000000)), }) maybe(err)