Skip to content

Commit

Permalink
moved redemption sweep to stride epoch (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampocs authored Aug 16, 2024
1 parent 3db83e2 commit 3a3745f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions x/stakeibc/keeper/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInf
if epochInfo.Identifier == epochstypes.DAY_EPOCH {
// Initiate unbondings from any hostZone where it's appropriate
k.InitiateAllHostZoneUnbondings(ctx, epochNumber)
// Check previous epochs to see if unbondings finished, and sweep the tokens if so
k.SweepUnbondedTokensAllHostZones(ctx)
// Cleanup any records that are no longer needed
k.CleanupEpochUnbondingRecords(ctx, epochNumber)
// Create an empty unbonding record for this epoch
Expand Down Expand Up @@ -80,6 +78,10 @@ func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInf
k.RebalanceAllHostZones(ctx)
}

// Check previous epochs to see if unbondings finished, and sends the relevant tokens
// to the redemption account
k.SweepUnbondedTokensAllHostZones(ctx)

// Transfers in and out of tokens for hostZones which have community pools
k.ProcessAllCommunityPoolTokens(ctx)

Expand Down
2 changes: 1 addition & 1 deletion x/stakeibc/keeper/redemption_sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (k Keeper) SweepUnbondedTokensForHostZone(ctx sdk.Context, hostZone types.H
}

// Send the bank send ICA
_, err = k.SubmitTxsDayEpoch(ctx, hostZone.ConnectionId, msgs, types.ICAAccountType_DELEGATION, ICACallbackID_Redemption, marshalledCallbackArgs)
_, err = k.SubmitTxsStrideEpoch(ctx, hostZone.ConnectionId, msgs, types.ICAAccountType_DELEGATION, ICACallbackID_Redemption, marshalledCallbackArgs)
if err != nil {
return errorsmod.Wrapf(err, "unable to submit redemption ICA for %s", chainId)
}
Expand Down

0 comments on commit 3a3745f

Please sign in to comment.