From 84ccdfd45b8cf231f2e20439a88656a5aca70a5f Mon Sep 17 00:00:00 2001 From: tnv1 Date: Thu, 11 Jan 2024 17:16:21 +0700 Subject: [PATCH] Fix logic delete host zone config --- x/feeabs/keeper/config.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/x/feeabs/keeper/config.go b/x/feeabs/keeper/config.go index 6b69f83e..bc71fae1 100644 --- a/x/feeabs/keeper/config.go +++ b/x/feeabs/keeper/config.go @@ -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 }