diff --git a/Makefile b/Makefile index 7e8098c..492ec6e 100644 --- a/Makefile +++ b/Makefile @@ -131,9 +131,9 @@ ictest-query-osmosis-twap: cd tests/interchaintest && go test -timeout=25m -race -v -run TestQueryOsmosisTwap . # Executes all tests via interchaintest after compling a local image as juno:local -ictest-all: ictest-basic ictest-ibc ictest-packet-forward +ictest-all: ictest-basic ictest-ibc ictest-packet-forward ictest-host-zone-proposal ictest-query-osmosis-twap ictest-feeabs -.PHONY: ictest-basic ictest-ibc ictest-packet-forward ictest-all +.PHONY: ictest-basic ictest-ibc ictest-packet-forward ictest-all ictest-host-zone-proposal ictest-query-osmosis-twap ictest-feeabs ############################################################################### ### Proto ### diff --git a/tests/interchaintest/feeabs/proposal.go b/tests/interchaintest/feeabs/proposal.go index 0d8a449..a7dadbe 100644 --- a/tests/interchaintest/feeabs/proposal.go +++ b/tests/interchaintest/feeabs/proposal.go @@ -117,6 +117,7 @@ func AddHostZoneProposal(c *cosmos.CosmosChain, ctx context.Context, keyName str command := []string{ "gov", "submit-legacy-proposal", "add-hostzone-config", filePath, + "--gas", "auto", "--gas-adjustment", "1.5", } return tn.ExecTx(ctx, keyName, command...) } @@ -140,6 +141,7 @@ func DeleteHostZoneProposal(c *cosmos.CosmosChain, ctx context.Context, keyName command := []string{ "gov", "submit-legacy-proposal", "delete-hostzone-config", filePath, + "--gas", "auto", "--gas-adjustment", "1.5", } return tn.ExecTx(ctx, keyName, command...) } @@ -163,6 +165,7 @@ func SetHostZoneProposal(c *cosmos.CosmosChain, ctx context.Context, keyName str command := []string{ "gov", "submit-legacy-proposal", "set-hostzone-config", filePath, + "--gas", "auto", "--gas-adjustment", "1.5", } return tn.ExecTx(ctx, keyName, command...) } diff --git a/x/feeabs/keeper/proposal.go b/x/feeabs/keeper/proposal.go index 76e8e48..5c326af 100644 --- a/x/feeabs/keeper/proposal.go +++ b/x/feeabs/keeper/proposal.go @@ -1,6 +1,8 @@ package keeper import ( + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types" @@ -8,7 +10,7 @@ import ( func (k Keeper) AddHostZoneProposal(ctx sdk.Context, p *types.AddHostZoneProposal) error { if k.HasHostZoneConfig(ctx, p.HostChainConfig.IbcDenom) { - return types.ErrDuplicateHostZoneConfig + return errors.Wrapf(types.ErrDuplicateHostZoneConfig, "duplicate host ibc denom") } if err := k.SetHostZoneConfig(ctx, *p.HostChainConfig); err != nil { @@ -24,9 +26,15 @@ func (k Keeper) DeleteHostZoneProposal(ctx sdk.Context, p *types.DeleteHostZoneP func (k Keeper) SetHostZoneProposal(ctx sdk.Context, p *types.SetHostZoneProposal) error { if !k.HasHostZoneConfig(ctx, p.HostChainConfig.IbcDenom) { - return types.ErrHostZoneConfigNotFound + return errors.Wrapf(types.ErrHostZoneConfigNotFound, "host ibc denom not found: %s", p.HostChainConfig.IbcDenom) + } + + // delete old host zone config + if err := k.DeleteHostZoneConfig(ctx, p.HostChainConfig.IbcDenom); err != nil { + return err } + // set new host zone config if err := k.SetHostZoneConfig(ctx, *p.HostChainConfig); err != nil { return err } diff --git a/x/feeabs/types/epoch.go b/x/feeabs/types/epoch.go index 32cd37e..53f8acd 100644 --- a/x/feeabs/types/epoch.go +++ b/x/feeabs/types/epoch.go @@ -6,8 +6,8 @@ import ( ) const ( - DefaultSwapPeriod = time.Minute * 1 - DefaultQueryPeriod = time.Minute * 1 + DefaultSwapPeriod = time.Minute * 5 + DefaultQueryPeriod = time.Minute * 5 DefaultSwapEpochIdentifier = "swap" DefaultQueryEpochIdentifier = "query" )