Skip to content

Commit

Permalink
fix: fix for comment
Browse files Browse the repository at this point in the history
Signed-off-by: 170210 <[email protected]>
  • Loading branch information
170210 committed May 14, 2024
1 parent cb6d624 commit bf8eb97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
6 changes: 1 addition & 5 deletions x/fswap/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
}
Expand Down
12 changes: 1 addition & 11 deletions x/fswap/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
})
}
Expand Down

0 comments on commit bf8eb97

Please sign in to comment.