Skip to content

Commit

Permalink
Fix logic delete host zone config
Browse files Browse the repository at this point in the history
  • Loading branch information
tnv1 committed Jan 11, 2024
1 parent 835981a commit 84ccdfd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions x/feeabs/keeper/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,16 @@ func (k Keeper) SetHostZoneConfig(ctx sdk.Context, chainConfig types.HostChainFe
}

func (k Keeper) DeleteHostZoneConfig(ctx sdk.Context, ibcDenom string) error {
store := ctx.KVStore(k.storeKey)
hostZoneConfig, ok := k.GetHostZoneConfig(ctx, ibcDenom)
if !ok {
return types.ErrHostZoneConfigNotFound
if ok {
key := types.GetKeyHostZoneConfigByOsmosisIBCDenom(hostZoneConfig.OsmosisPoolTokenDenomIn)
store.Delete(key)
}
store := ctx.KVStore(k.storeKey)

key := types.GetKeyHostZoneConfigByFeeabsIBCDenom(ibcDenom)
store.Delete(key)

key = types.GetKeyHostZoneConfigByOsmosisIBCDenom(hostZoneConfig.OsmosisPoolTokenDenomIn)
store.Delete(key)

return nil
}

Expand Down

0 comments on commit 84ccdfd

Please sign in to comment.