Skip to content

Commit

Permalink
Test for TriggerRedemptionRate (#655)
Browse files Browse the repository at this point in the history
* add trigger redemption rate test

* lint
  • Loading branch information
phamminh0811 authored Sep 28, 2023
1 parent 8fc6f20 commit 1457e3d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions x/interchainstaking/keeper/ibc_packet_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2754,3 +2754,34 @@ func (suite *KeeperTestSuite) TestHandleMaturedUbondings() {
})
}
}

func (suite *KeeperTestSuite) TestTriggerRedemptionRate() {
suite.Run("trigger redemption rate", func() {
suite.SetupTest()
suite.setupTestZones()

quicksilver := suite.GetQuicksilverApp(suite.chainA)
ctx := suite.chainA.GetContext()

zone, _ := quicksilver.InterchainstakingKeeper.GetZone(ctx, suite.chainB.ChainID)

prevAllBalancesQueryCnt := 0
for _, query := range quicksilver.InterchainQueryKeeper.AllQueries(ctx) {
if query.QueryType == "cosmos.bank.v1beta1.Query/AllBalances" {
prevAllBalancesQueryCnt++
}
}

err := quicksilver.InterchainstakingKeeper.TriggerRedemptionRate(ctx, &zone)
suite.NoError(err)

allBalancesQueryCnt := 0
for _, query := range quicksilver.InterchainQueryKeeper.AllQueries(ctx) {
if query.QueryType == "cosmos.bank.v1beta1.Query/AllBalances" {
allBalancesQueryCnt++
}
}

suite.Equal(prevAllBalancesQueryCnt+1, allBalancesQueryCnt)
})
}

0 comments on commit 1457e3d

Please sign in to comment.