Skip to content

Commit 7d8660b

Browse files
committed
fix: gas price bump calculation
1 parent 3469101 commit 7d8660b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/utils/eth_client_utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ func BytesToQuorumThresholdPercentages(quorumThresholdPercentagesBytes []byte) e
5151
// Very basic algorithm to calculate the gasPrice bump based on the currentGasPrice and percentage.
5252
// It adds a the percentage to the current gas price.
5353
func CalculateGasPriceBump(currentGasPrice *big.Int, percentage int) *big.Int {
54-
percentageBump := new(big.Int).Div(big.NewInt(int64(percentage)), big.NewInt(100))
54+
percentageBump := big.NewInt(int64(percentage))
5555
bumpAmount := new(big.Int).Mul(currentGasPrice, percentageBump)
56+
bumpAmount = new(big.Int).Div(bumpAmount, big.NewInt(100))
5657
bumpedGasPrice := new(big.Int).Add(currentGasPrice, bumpAmount)
5758

5859
return bumpedGasPrice

0 commit comments

Comments
 (0)