Skip to content

Commit

Permalink
updating testcases- vault & liquidity module
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikasr committed Sep 28, 2023
1 parent aa87619 commit 5aa6817
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion x/liquidity/keeper/pair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (s *KeeperTestSuite) TestCreatePair() {
Msg: *types.NewMsgCreatePair(
appID1, addr1, asset1.Denom, asset2.Denom,
),
ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "0ucmdx is smaller than 2000000000ucmdx"), "insufficient pair creation fee"),
ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 2000000000ucmdx"), "insufficient pair creation fee"),
ExpResp: &types.Pair{},
QueryResponseIndex: 0,
QueryResponse: nil,
Expand Down
12 changes: 6 additions & 6 deletions x/liquidity/keeper/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (s *KeeperTestSuite) TestCreatePool() {
Msg: *types.NewMsgCreatePool(
appID1, addr1, dummyPair1.Id, sdk.NewCoins(sdk.NewCoin(dummyPair1.BaseCoinDenom, sdk.NewInt(1000000000000)), sdk.NewCoin(dummyPair1.QuoteCoinDenom, sdk.NewInt(1000000000000))),
),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "0%s is smaller than 1000000000000%s", dummyPair1.QuoteCoinDenom, dummyPair1.QuoteCoinDenom),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 1000000000000%s", dummyPair1.QuoteCoinDenom),
ExpResp: &types.Pool{},
QueryResponseIndex: 0,
QueryResponse: nil,
Expand All @@ -135,7 +135,7 @@ func (s *KeeperTestSuite) TestCreatePool() {
Msg: *types.NewMsgCreatePool(
appID1, addr1, dummyPair2.Id, sdk.NewCoins(sdk.NewCoin(dummyPair2.BaseCoinDenom, sdk.NewInt(1000000000000)), sdk.NewCoin(dummyPair2.QuoteCoinDenom, sdk.NewInt(1000000000000))),
),
ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "0%s is smaller than %s", params.PoolCreationFee[0].Denom, params.PoolCreationFee[0].String()), "insufficient pool creation fee"),
ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than %s", params.PoolCreationFee[0].String()), "insufficient pool creation fee"),
ExpResp: &types.Pool{},
QueryResponseIndex: 0,
QueryResponse: nil,
Expand Down Expand Up @@ -450,7 +450,7 @@ func (s *KeeperTestSuite) TestDeposit() {
Msg: *types.NewMsgDeposit(
appID1, addr1, app1Pool.Id, sdk.NewCoins(sdk.NewCoin(app1Pair.BaseCoinDenom, sdk.NewInt(100000000)), sdk.NewCoin(app1Pair.QuoteCoinDenom, sdk.NewInt(100000000))),
),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "0%s is smaller than 100000000%s", app1Pair.BaseCoinDenom, app1Pair.BaseCoinDenom),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 100000000%s", app1Pair.BaseCoinDenom),
ExpResp: &types.DepositRequest{},
QueryResponseIndex: 0,
QueryResponse: nil,
Expand Down Expand Up @@ -734,7 +734,7 @@ func (s *KeeperTestSuite) TestWithdraw() {
Msg: *types.NewMsgWithdraw(
appID1, addr1, pool.Id, availablePoolBalance.Add(sdk.NewCoin(availablePoolBalance.Denom, availablePoolBalance.Amount.Add(newInt(1000)))),
),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "%s is smaller than %s", availablePoolBalance.String(), availablePoolBalance.Add(sdk.NewCoin(availablePoolBalance.Denom, availablePoolBalance.Amount.Add(newInt(1000)))).String()),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance %s is smaller than %s", availablePoolBalance.String(), availablePoolBalance.Add(sdk.NewCoin(availablePoolBalance.Denom, availablePoolBalance.Amount.Add(newInt(1000)))).String()),
ExpResp: &types.WithdrawRequest{},
AvailableBalance: sdk.NewCoins(),
},
Expand Down Expand Up @@ -1055,7 +1055,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() {
appID1, addr1, dummyPair1.Id, sdk.NewCoins(sdk.NewCoin(dummyPair1.BaseCoinDenom, sdk.NewInt(1000000000000)), sdk.NewCoin(dummyPair1.QuoteCoinDenom, sdk.NewInt(1000000000000))),
sdk.MustNewDecFromStr("0.99"), sdk.MustNewDecFromStr("1.01"), sdk.MustNewDecFromStr("1"),
),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "0%s is smaller than 1000000000000%s", dummyPair1.QuoteCoinDenom, dummyPair1.QuoteCoinDenom),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than 1000000000000%s", dummyPair1.QuoteCoinDenom),
ExpResp: &types.Pool{},
QueryResponseIndex: 0,
QueryResponse: nil,
Expand All @@ -1069,7 +1069,7 @@ func (s *KeeperTestSuite) TestCreateRangedPool() {
appID1, addr1, dummyPair2.Id, sdk.NewCoins(sdk.NewCoin(dummyPair2.BaseCoinDenom, sdk.NewInt(1000000000000)), sdk.NewCoin(dummyPair2.QuoteCoinDenom, sdk.NewInt(1000000000000))),
sdk.MustNewDecFromStr("0.99"), sdk.MustNewDecFromStr("1.01"), sdk.MustNewDecFromStr("1"),
),
ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "0%s is smaller than %s", params.PoolCreationFee[0].Denom, params.PoolCreationFee[0].String()), "insufficient pool creation fee"),
ExpErr: sdkerrors.Wrap(sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance is smaller than %s", params.PoolCreationFee[0].String()), "insufficient pool creation fee"),
ExpResp: &types.Pool{},
QueryResponseIndex: 0,
QueryResponse: nil,
Expand Down
2 changes: 1 addition & 1 deletion x/liquidity/keeper/rewards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (s *KeeperTestSuite) TestFarm() {
{
Name: "error insufficient pool denoms",
Msg: *types.NewMsgFarm(appID1, pool.Id, liquidityProvider1, utils.ParseCoin("100000000000pool1-1")),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "10000000000pool1-1 is smaller than 100000000000pool1-1"),
ExpErr: sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "spendable balance 10000000000pool1-1 is smaller than 100000000000pool1-1"),
AvailableBalance: utils.ParseCoins("10000000000pool1-1,10000000000pool2-1"),
},
{
Expand Down
4 changes: 2 additions & 2 deletions x/vault/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (s *KeeperTestSuite) TestMsgCreate() {
Msg: *types.NewMsgCreateRequest(
addr1, appID1, extendedVaultPairID1, newInt(1000000000), newInt(200000000),
),
ExpErr: fmt.Errorf(fmt.Sprintf("0uasset1 is smaller than %duasset1: insufficient funds", 1000000000)),
ExpErr: fmt.Errorf(fmt.Sprintf("spendable balance is smaller than %duasset1: insufficient funds", 1000000000)),
ExpResp: nil,
QueryResponseIndex: 0,
QueryResponse: nil,
Expand Down Expand Up @@ -399,7 +399,7 @@ func (s *KeeperTestSuite) TestMsgDeposit() {
Msg: *types.NewMsgDepositRequest(
addr1, appID1, extendedVaultPairID1, 1, newInt(69000000),
),
ExpErr: fmt.Errorf(fmt.Sprintf("0uasset1 is smaller than %duasset1: insufficient funds", 69000000)),
ExpErr: fmt.Errorf(fmt.Sprintf("spendable balance is smaller than %duasset1: insufficient funds", 69000000)),
ExpResp: nil,
QueryResponseIndex: 0,
QueryResponse: nil,
Expand Down

0 comments on commit 5aa6817

Please sign in to comment.