From 718b66f9d4b3f750aec18c80d62b2da27370b456 Mon Sep 17 00:00:00 2001 From: sampocs Date: Tue, 2 Aug 2022 21:53:58 -0500 Subject: [PATCH] removed forced timeout in hooks --- x/stakeibc/keeper/hooks.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/x/stakeibc/keeper/hooks.go b/x/stakeibc/keeper/hooks.go index a32173d1e..884f34a6e 100644 --- a/x/stakeibc/keeper/hooks.go +++ b/x/stakeibc/keeper/hooks.go @@ -78,7 +78,7 @@ func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInf depositRecords := k.RecordsKeeper.GetAllDepositRecord(ctx) // Update the redemption rate - redemptionRateInterval := cast.ToInt64(k.GetParam(ctx, types.KeyDepositInterval)) + redemptionRateInterval := cast.ToInt64(k.GetParam(ctx, types.KeyRedemptionRateInterval)) if epochNumber%redemptionRateInterval == 0 { k.Logger(ctx).Info("Triggering update redemption rate") k.UpdateRedemptionRates(ctx, depositRecords) @@ -248,7 +248,7 @@ func (k Keeper) TransferExistingDepositsToHostZones(ctx sdk.Context, epochNumber transferDepositRecords := utils.FilterDepositRecords(depositRecords, func(record recordstypes.DepositRecord) (condition bool) { return record.Status == recordstypes.DepositRecord_TRANSFER }) - // ibcTimeoutBlocks := cast.ToUint64(k.GetParam(ctx, types.KeyIbcTimeoutBlocks)) + ibcTimeoutBlocks := cast.ToUint64(k.GetParam(ctx, types.KeyIbcTimeoutBlocks)) addr := k.accountKeeper.GetModuleAccount(ctx, types.ModuleName).GetAddress().String() var emptyRecords []uint64 for _, depositRecord := range transferDepositRecords { @@ -282,14 +282,10 @@ func (k Keeper) TransferExistingDepositsToHostZones(ctx sdk.Context, epochNumber } else { k.Logger(ctx).Info(fmt.Sprintf("Found blockHeight for host zone %s: %d", hostZone.ConnectionId, blockHeight)) } - timeoutHeight := clienttypes.NewHeight(0, cast.ToUint64(blockHeight)+1) + timeoutHeight := clienttypes.NewHeight(0, cast.ToUint64(blockHeight)+ibcTimeoutBlocks) transferCoin := sdk.NewCoin(hostZone.GetIBCDenom(), sdk.NewInt(int64(depositRecord.Amount))) goCtx := sdk.WrapSDKContext(ctx) - a, _ := sdk.AccAddressFromBech32("stride1mvdq4nlupl39243qjz7sds5ez3rl9mnx253lza") - gaiaBalance := k.bankKeeper.GetBalance(ctx, a, "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2") - fmt.Println("GAIA BALANCE BEFORE TRANSFER:", gaiaBalance) - msg := ibctypes.NewMsgTransfer("transfer", hostZone.TransferChannelId, transferCoin, addr, delegateAddress, timeoutHeight, 0) k.Logger(ctx).Info("TransferExistingDepositsToHostZones msg:", msg) _, err := k.TransferKeeper.Transfer(goCtx, msg)