Skip to content

Commit

Permalink
correct time
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Jul 18, 2023
1 parent 4677af9 commit ebdb14e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/transfermiddleware/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func (k Keeper) BeginBlocker(ctx sdk.Context) {
// Iterate over remove list
k.IterateRemoveListInfo(ctx, func(removeList types.RemoveParachainIBCTokenInfo) (stop bool) {
// If pass the duration, remove parachain token info
if removeList.RemoveTime.After(ctx.BlockTime()) {
if ctx.BlockTime().After(removeList.RemoveTime) {
k.RemoveParachainIBCInfo(ctx, removeList.NativeDenom)
}

Expand Down
4 changes: 4 additions & 0 deletions x/transfermiddleware/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ func (keeper Keeper) AddParachainIBCInfo(ctx sdk.Context, ibcDenom, channelID, n
return nil
}

// TODO: testing
// AddParachainIBCInfoToRemoveList add parachain token information token to remove list.
func (keeper Keeper) AddParachainIBCInfoToRemoveList(ctx sdk.Context, nativeDenom string) (time.Time, error) {
params := keeper.GetParams(ctx)
store := ctx.KVStore(keeper.storeKey)
Expand All @@ -110,6 +112,8 @@ func (keeper Keeper) AddParachainIBCInfoToRemoveList(ctx sdk.Context, nativeDeno
return removeTime, nil
}

// TODO: testing
// IterateRemoveListInfo iterate all parachain token in remove list.
func (keeper Keeper) IterateRemoveListInfo(ctx sdk.Context, cb func(removeInfo types.RemoveParachainIBCTokenInfo) (stop bool)) {
store := ctx.KVStore(keeper.storeKey)
iterator := sdk.KVStorePrefixIterator(store, types.KeyParachainIBCTokenRemoveListByNativeDenom)
Expand Down

0 comments on commit ebdb14e

Please sign in to comment.