From bf8eb978321424c375848ce5b6f027052aa71dee Mon Sep 17 00:00:00 2001 From: 170210 Date: Tue, 14 May 2024 14:51:21 +0900 Subject: [PATCH] fix: fix for comment Signed-off-by: 170210 --- x/fswap/keeper/keeper.go | 6 +----- x/fswap/keeper/keeper_test.go | 12 +----------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/x/fswap/keeper/keeper.go b/x/fswap/keeper/keeper.go index bfd6bbf9a9..eb92bb5fe6 100644 --- a/x/fswap/keeper/keeper.go +++ b/x/fswap/keeper/keeper.go @@ -29,7 +29,7 @@ func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, config types } if addr := ak.GetModuleAddress(types.ModuleName); addr == nil { - panic("fbridge module account has not been set") + panic("fswap module account has not been set") } found := false @@ -131,10 +131,6 @@ func (k Keeper) SetSwap(ctx sdk.Context, swap types.Swap, toDenomMetadata bank.M return types.ErrCanNotHaveMoreSwap.Wrapf("cannot make more swaps, max swaps is %d", k.config.MaxSwaps) } - if swap.ToDenom != toDenomMetadata.Base { - return sdkerrors.ErrInvalidRequest.Wrap("toDenom should be existed in metadata") - } - if !k.HasSupply(ctx, swap.FromDenom) { return sdkerrors.ErrInvalidRequest.Wrap("fromDenom should be existed in chain") } diff --git a/x/fswap/keeper/keeper_test.go b/x/fswap/keeper/keeper_test.go index 31f2b43706..cd1f3a38ad 100644 --- a/x/fswap/keeper/keeper_test.go +++ b/x/fswap/keeper/keeper_test.go @@ -281,16 +281,6 @@ func (s *KeeperTestSuite) TestSetSwap() { s.toDenomMetadata, sdkerrors.ErrInvalidRequest, }, - "to-denom does not equal with metadata": { - types.Swap{ - FromDenom: "fromdenom", - ToDenom: "fakedenom", - AmountCapForToDenom: sdk.OneInt(), - SwapRate: sdk.OneDec(), - }, - s.toDenomMetadata, - sdkerrors.ErrInvalidRequest, - }, "to-denom metadata change not allowed": { types.Swap{ FromDenom: "fromdenom", @@ -312,7 +302,7 @@ func (s *KeeperTestSuite) TestSetSwap() { for name, tc := range testCases { s.Run(name, func() { ctx, _ := s.ctx.CacheContext() - err := s.keeper.SetSwap(ctx, tc.swap, s.toDenomMetadata) + err := s.keeper.SetSwap(ctx, tc.swap, tc.toDenomMeta) s.Require().ErrorIs(err, tc.expectedError) }) }