Skip to content

Commit 6ec7df2

Browse files
committed
oops
1 parent f60ee79 commit 6ec7df2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

protocol/lib/big_math.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ func BigRatMulPpm(input *big.Rat, ppm uint32) *big.Rat {
103103
)
104104
}
105105

106+
var OneMillionUint256 = uint256.NewInt(1_000_000)
107+
106108
func MulPpmUint256(input *uint256.Int, ppm uint32) *uint256.Int {
107109
result := new(uint256.Int).Mul(input, uint256.NewInt(uint64(ppm)))
108-
return result.Div(result, uint256.NewInt(1_000_000))
110+
return result.Div(result, OneMillionUint256)
109111
}
110112

111113
// bigGenericClamp is a helper function for BigRatClamp and BigIntClamp

protocol/x/subaccounts/keeper/subaccount.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ func (k Keeper) CanUpdateSubaccountsUint256(
457457
}
458458

459459
allPerps := k.perpetualsKeeper.GetAllPerpetuals(ctx)
460-
success, successPerUpdate, err = k.internalCanUpdateSubaccounts(ctx, settledUpdates, updateType, allPerps)
460+
success, successPerUpdate, err = k.internalCanUpdateSubaccountsUint256(ctx, settledUpdates, updateType, allPerps)
461461
return success, successPerUpdate, err
462462
}
463463

0 commit comments

Comments
 (0)