Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hostzone check ante handler #100

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions x/feeabs/ante/decorate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions x/feeabs/types/epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
1 change: 1 addition & 0 deletions x/feeabs/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Loading