Skip to content

Commit

Permalink
test: add points check
Browse files Browse the repository at this point in the history
  • Loading branch information
shifty11 committed Aug 1, 2024
1 parent dfd70e2 commit 3c0260d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions x/bundles/keeper/msg_server_skip_uploader_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() {
// check that the bundle is not finalized
_, found = s.App().BundlesKeeper.GetFinalizedBundle(s.Ctx(), 0, 0)
Expect(found).To(BeFalse())

// check that no validator got a point for the second round
valaccounts := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0)
for _, valaccount := range valaccounts {
if valaccount.Staker == i.STAKER_0 {
Expect(valaccount.Points).To(BeZero())
} else {
Expect(valaccount.Points).To(Equal(uint64(1))) // from the first round
}
}
})

It("Skip uploader on data bundle after uploader role has already been skipped", func() {
Expand Down Expand Up @@ -211,7 +221,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() {
_, found = s.App().BundlesKeeper.GetFinalizedBundle(s.Ctx(), 0, 0)
Expect(found).To(BeFalse())

// check if no validator got a point for the second round
// check that no validator got a point for the second round
valaccounts := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0)
for _, valaccount := range valaccounts {
if valaccount.Staker == i.STAKER_0 {
Expand Down Expand Up @@ -264,7 +274,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() {
_, found = s.App().BundlesKeeper.GetFinalizedBundle(s.Ctx(), 0, 0)
Expect(found).To(BeFalse())

// check if no validator got a point for the second round
// check that no validator got a point for the second round
valaccounts := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0)
for _, valaccount := range valaccounts {
if valaccount.Staker == i.STAKER_0 {
Expand Down

0 comments on commit 3c0260d

Please sign in to comment.