Skip to content

Commit

Permalink
build-eth-block: use live gas price (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroXbrock authored Apr 12, 2024
1 parent 295816b commit bf73579
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/build-eth-block/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit bf73579

Please sign in to comment.