From 3c0260d7f5345093897298826fde76fca1c98617 Mon Sep 17 00:00:00 2001 From: rapha Date: Thu, 1 Aug 2024 09:04:29 +0200 Subject: [PATCH] test: add points check --- .../keeper/msg_server_skip_uploader_role_test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/x/bundles/keeper/msg_server_skip_uploader_role_test.go b/x/bundles/keeper/msg_server_skip_uploader_role_test.go index 9f0ac3d0..ef706865 100644 --- a/x/bundles/keeper/msg_server_skip_uploader_role_test.go +++ b/x/bundles/keeper/msg_server_skip_uploader_role_test.go @@ -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() { @@ -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 { @@ -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 {