Skip to content

Commit

Permalink
test: move resetting of team allocation to DeferCleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shifty11 committed Jun 3, 2024
1 parent 7359e08 commit e26b187
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions x/bundles/keeper/keeper_suite_inflation_splitting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ var _ = Describe("inflation splitting", Ordered, func() {
})

s.CommitAfterSeconds(60)

// Important: Reset changes of global variables as they will not be reverted by the s.NewCleanChain()
originalTeamAllocation := teamTypes.TEAM_ALLOCATION
DeferCleanup(func() {
teamTypes.TEAM_ALLOCATION = originalTeamAllocation
})
})

AfterEach(func() {
Expand Down Expand Up @@ -1577,9 +1583,6 @@ var _ = Describe("inflation splitting", Ordered, func() {
// assert total pool funds
Expect(s.App().FundersKeeper.GetTotalActiveFunding(s.Ctx(), fundingState.PoolId)).To(BeZero())
Expect(fundingState.ActiveFunderAddresses).To(BeEmpty())

// Important: Reset changes of global variables as they will not be reverted by the s.NewCleanChain()
teamTypes.TEAM_ALLOCATION = 165000000000000000
})

It("Produce a valid bundle with no funders, 10% inflation splitting and pool-0 = 1.0 weight and pool-1 = 1.0 weight", func() {
Expand Down Expand Up @@ -1728,8 +1731,5 @@ var _ = Describe("inflation splitting", Ordered, func() {
// assert total pool funds
Expect(s.App().FundersKeeper.GetTotalActiveFunding(s.Ctx(), fundingState.PoolId)).To(BeZero())
Expect(fundingState.ActiveFunderAddresses).To(BeEmpty())

// Important: Reset changes of global variables as they will not be reverted by the s.NewCleanChain()
teamTypes.TEAM_ALLOCATION = 165000000000000000
})
})

0 comments on commit e26b187

Please sign in to comment.