Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
puneet2019 committed Dec 21, 2023
1 parent 6569a47 commit 0f96568
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions x/liquidstakeibc/keeper/deposit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (suite *IntegrationTestSuite) TestAdjustDepositsForRedemption() {
redemptionAmount: sdk.Coin{Denom: HostDenom, Amount: sdk.NewInt(5000)},
},
{
name: "Case 2",
name: "try partial redeem",
deposits: []*types.Deposit{
{
ChainId: suite.chainB.ChainID,
Expand All @@ -119,6 +119,7 @@ func (suite *IntegrationTestSuite) TestAdjustDepositsForRedemption() {
epoch: {Denom: HostDenom, Amount: sdk.NewInt(3500)},
},
redemptionAmount: sdk.Coin{Denom: HostDenom, Amount: sdk.NewInt(5000)},
err: types.ErrInsufficientDeposits,
},
{
name: "Case 3",
Expand Down Expand Up @@ -210,7 +211,11 @@ func (suite *IntegrationTestSuite) TestAdjustDepositsForRedemption() {
t.redemptionAmount,
)

suite.Require().Equal(t.err, err)
if t.err == nil {
suite.Require().Equal(t.err, err)
} else {
suite.Require().ErrorContains(err, t.err.Error())
}

for epoch, deposit := range t.expected {
depositState, ok := suite.app.LiquidStakeIBCKeeper.GetDepositForChainAndEpoch(suite.ctx, suite.chainB.ChainID, epoch)
Expand Down

0 comments on commit 0f96568

Please sign in to comment.