Skip to content

Commit

Permalink
Merge branch '311-aggregator-wait-for-receipt-for-1-minute-if-not-bum…
Browse files Browse the repository at this point in the history
…p-the-fee-v2' into test-aggregator-bump-fee
  • Loading branch information
MarcosNicolau committed Oct 22, 2024
2 parents f40d017 + 7d8660b commit 194b9c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/utils/eth_client_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ func BytesToQuorumThresholdPercentages(quorumThresholdPercentagesBytes []byte) e
// Very basic algorithm to calculate the gasPrice bump based on the currentGasPrice and percentage.
// It adds a the percentage to the current gas price.
func CalculateGasPriceBump(currentGasPrice *big.Int, percentage int) *big.Int {
percentageBump := new(big.Int).Div(big.NewInt(int64(percentage)), big.NewInt(100))
percentageBump := big.NewInt(int64(percentage))
bumpAmount := new(big.Int).Mul(currentGasPrice, percentageBump)
bumpAmount = new(big.Int).Div(bumpAmount, big.NewInt(100))
bumpedGasPrice := new(big.Int).Add(currentGasPrice, bumpAmount)

return bumpedGasPrice
Expand Down

0 comments on commit 194b9c9

Please sign in to comment.