Skip to content

Commit dbc7d60

Browse files
committed
docs: SendTransactionWithInfiniteRetryAndBumpingGasPrice
1 parent 10597b0 commit dbc7d60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/utils/eth_client_utils.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ func CalculateGasPriceBumpBasedOnRetry(currentGasPrice *big.Int, iteration int)
6060
}
6161

6262
// Sends a transaction and waits for the receipt for three blocks, if not received
63-
// it will try again bumping the gas price based on `CalculateGasPriceBumpBasedOnRetry`.
64-
// This process happens indefinitely until we get the receipt or the receipt status is an err
63+
// it will try again bumping the gas price based on `CalculateGasPriceBumpBasedOnRetry`
64+
// and pass it to beforeTransaction and executeTransaction (make sure you update the txOpts with the new price)
65+
// This process happens indefinitely until we get the receipt or the receipt status is an err.
6566
func SendTransactionWithInfiniteRetryAndBumpingGasPrice(beforeTransaction func(*big.Int) error, executeTransaction func(*big.Int) (*types.Transaction, error), client eth.InstrumentedClient, baseGasPrice *big.Int) (*types.Receipt, error) {
6667
i := 0
6768
sendTransaction := func() (*types.Receipt, error) {

0 commit comments

Comments
 (0)