From e4eb7c1285d7b496329d751c1a53e90632758c3c Mon Sep 17 00:00:00 2001 From: puneetmahajan Date: Thu, 21 Dec 2023 10:35:17 +0530 Subject: [PATCH] refactor name --- x/liquidstakeibc/keeper/deposit.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/x/liquidstakeibc/keeper/deposit.go b/x/liquidstakeibc/keeper/deposit.go index b6722b62e..9dca878a9 100644 --- a/x/liquidstakeibc/keeper/deposit.go +++ b/x/liquidstakeibc/keeper/deposit.go @@ -74,23 +74,23 @@ func (k *Keeper) GetTransactionSequenceID(channelID string, sequence uint64) str func (k *Keeper) AdjustDepositsForRedemption( ctx sdk.Context, hc *liquidstakeibctypes.HostChain, - redeemableAmount sdk.Coin, + redeemAmount sdk.Coin, ) error { redeemableDeposits, depositsAmount := k.GetRedeemableDepositsForHostChain(ctx, hc) - if depositsAmount.LT(redeemableAmount.Amount) { - return errorsmod.Wrapf(liquidstakeibctypes.ErrInsufficientDeposits, "deposits are lesser than amount to be redeemed, deposits present %s, required %s", depositsAmount.String(), redeemableAmount.Amount.String()) + if depositsAmount.LT(redeemAmount.Amount) { + return errorsmod.Wrapf(liquidstakeibctypes.ErrInsufficientDeposits, "deposits are lesser than amount to be redeemed, deposits present %s, required %s", depositsAmount.String(), redeemAmount.Amount.String()) } for _, deposit := range redeemableDeposits { // there is enough tokens in this deposit to fulfill the redeem request - if deposit.Amount.Amount.GT(redeemableAmount.Amount) || redeemableAmount.IsZero() { - deposit.Amount = deposit.Amount.Sub(redeemableAmount) + if deposit.Amount.Amount.GT(redeemAmount.Amount) || redeemAmount.IsZero() { + deposit.Amount = deposit.Amount.Sub(redeemAmount) k.SetDeposit(ctx, deposit) return nil } // the deposit is not enough to fulfill the redeem request, use it and remove it - redeemableAmount = redeemableAmount.Sub(deposit.Amount) + redeemAmount = redeemAmount.Sub(deposit.Amount) k.DeleteDeposit(ctx, deposit) }