Skip to content

Commit

Permalink
fix: remove un-used imports and update coinswap sim-op
Browse files Browse the repository at this point in the history
lstoken can be used as maxToken which is not registered as params. with no-op, we can proceed sim tests.
  • Loading branch information
zsystm committed Aug 11, 2023
1 parent 19c600f commit 38acbf4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package app
import (
"encoding/json"
"fmt"
inflationtypes "github.com/Canto-Network/Canto/v7/x/inflation/types"
"math/rand"
"os"
"testing"

Expand Down
8 changes: 8 additions & 0 deletions x/coinswap/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ func SimulateMsgAddLiquidity(k keeper.Keeper, ak types.AccountKeeper, bk types.B
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgAddLiquidity, "tokenDenom should not be liquidity token"), nil, err
}

params := k.GetParams(ctx)
if !params.MaxSwapAmount.AmountOf(maxToken.Denom).IsPositive() {
return simtypes.NoOpMsg(
types.ModuleName, types.TypeMsgAddLiquidity,
fmt.Sprintf("maxToken %s is not registered in max swap amount", maxToken.Denom),
), nil, err
}

if !maxToken.Amount.IsPositive() {
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgAddLiquidity, "maxToken must is positive"), nil, err
}
Expand Down

0 comments on commit 38acbf4

Please sign in to comment.