From 5681fc7265b760ae3a7900a74e806880532d6562 Mon Sep 17 00:00:00 2001 From: GnaD13 Date: Mon, 30 Oct 2023 14:39:36 +0700 Subject: [PATCH 1/2] reduce epoch time --- x/feeabs/types/epoch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/feeabs/types/epoch.go b/x/feeabs/types/epoch.go index 2c99f6cf..568c15df 100644 --- a/x/feeabs/types/epoch.go +++ b/x/feeabs/types/epoch.go @@ -6,8 +6,8 @@ import ( ) const ( - DefaultSwapPeriod time.Duration = time.Minute * 180 - DefaultQueryPeriod time.Duration = time.Minute * 60 + DefaultSwapPeriod time.Duration = time.Minute * 5 + DefaultQueryPeriod time.Duration = time.Minute * 5 DefaultSwapEpochIdentifier string = "swap" DefaultQueryEpochIdentifier string = "query" ) From 8beefb979f77ae685a5d6fcbaa66c23fe1d17f86 Mon Sep 17 00:00:00 2001 From: GnaD13 Date: Mon, 30 Oct 2023 14:57:12 +0700 Subject: [PATCH 2/2] add check hostzone ante handler --- x/feeabs/ante/decorate.go | 5 +++++ x/feeabs/types/errors.go | 1 + 2 files changed, 6 insertions(+) diff --git a/x/feeabs/ante/decorate.go b/x/feeabs/ante/decorate.go index c8fe4552..d74b155e 100644 --- a/x/feeabs/ante/decorate.go +++ b/x/feeabs/ante/decorate.go @@ -253,6 +253,11 @@ func (famfd FeeAbstrationMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk hasHostChainConfig := famfd.feeabsKeeper.HasHostZoneConfig(ctx, feeDenom) if hasHostChainConfig { hostChainConfig, _ := famfd.feeabsKeeper.GetHostZoneConfig(ctx, feeDenom) + // check if hostzone if frozen + if hostChainConfig.Frozen { + return ctx, feeabstypes.ErrHostZoneFrozen + } + nativeCoinsFees, err := famfd.feeabsKeeper.CalculateNativeFromIBCCoins(ctx, feeCoins, hostChainConfig) if err != nil { return ctx, sdkerrors.Wrapf(errorstypes.ErrInsufficientFee, "insufficient fees") diff --git a/x/feeabs/types/errors.go b/x/feeabs/types/errors.go index d941329b..4532da62 100644 --- a/x/feeabs/types/errors.go +++ b/x/feeabs/types/errors.go @@ -9,5 +9,6 @@ var ( ErrInvalidIBCFees = sdkerrors.Register(ModuleName, 2, "invalid ibc fees") ErrHostZoneConfigNotFound = sdkerrors.Register(ModuleName, 3, "host chain config not found") ErrDuplicateHostZoneConfig = sdkerrors.Register(ModuleName, 4, "duplicate config") + ErrHostZoneFrozen = sdkerrors.Register(ModuleName, 5, "hostzone frozen") ErrNotEnoughFundInModuleAddress = sdkerrors.Register(ModuleName, 6, "not have funding yet") )