Skip to content

Commit

Permalink
test: adjusted msg_server_vote_bundle_proposal_test.go in bundles module
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed Oct 27, 2023
1 parent e50d71a commit 50aba52
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions x/bundles/keeper/msg_server_vote_bundle_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import (
TEST CASES - msg_server_vote_bundle_proposal.go
* Try to vote valid as the only voter on bundle proposal
* Try to vote invalid as the only voter on bundle proposal
* Try to vote abstain as the only voter on bundle proposal
* Try to vote abstain on proposal again
* Try to vote valid on proposal after abstain vote
* Try to vote invalid on proposal after abstain vote
Expand Down Expand Up @@ -90,77 +87,12 @@ var _ = Describe("msg_server_vote_bundle_proposal.go", Ordered, func() {
ToKey: "99",
BundleSummary: "test_value",
})

s.RunTxStakersSuccess(&stakertypes.MsgCreateStaker{
Creator: i.STAKER_1,
Amount: 100 * i.KYVE,
})

s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{
Creator: i.STAKER_1,
PoolId: 0,
Valaddress: i.VALADDRESS_1_A,
})
})

AfterEach(func() {
s.PerformValidityChecks()
})

It("Try to vote valid as the only voter on bundle proposal", func() {
// ACT
s.RunTxBundlesSuccess(&bundletypes.MsgVoteBundleProposal{
Creator: i.VALADDRESS_1_A,
Staker: i.STAKER_1,
PoolId: 0,
StorageId: "y62A3tfbSNcNYDGoL-eXwzyV-Zc9Q0OVtDvR1biJmNI",
Vote: bundletypes.VOTE_TYPE_VALID,
})

// ASSERT
bundleProposal, _ := s.App().BundlesKeeper.GetBundleProposal(s.Ctx(), 0)

Expect(bundleProposal.VotersValid).To(ContainElement(i.STAKER_1))
Expect(bundleProposal.VotersInvalid).NotTo(ContainElement(i.STAKER_1))
Expect(bundleProposal.VotersAbstain).NotTo(ContainElement(i.STAKER_1))
})

It("Try to vote invalid as the only voter on bundle proposal", func() {
// ACT
s.RunTxBundlesSuccess(&bundletypes.MsgVoteBundleProposal{
Creator: i.VALADDRESS_1_A,
Staker: i.STAKER_1,
PoolId: 0,
StorageId: "y62A3tfbSNcNYDGoL-eXwzyV-Zc9Q0OVtDvR1biJmNI",
Vote: bundletypes.VOTE_TYPE_INVALID,
})

// ASSERT
bundleProposal, _ := s.App().BundlesKeeper.GetBundleProposal(s.Ctx(), 0)

Expect(bundleProposal.VotersValid).NotTo(ContainElement(i.STAKER_1))
Expect(bundleProposal.VotersInvalid).To(ContainElement(i.STAKER_1))
Expect(bundleProposal.VotersAbstain).NotTo(ContainElement(i.STAKER_1))
})

It("Try to vote abstain as the only voter on bundle proposal", func() {
// ACT
s.RunTxBundlesSuccess(&bundletypes.MsgVoteBundleProposal{
Creator: i.VALADDRESS_1_A,
Staker: i.STAKER_1,
PoolId: 0,
StorageId: "y62A3tfbSNcNYDGoL-eXwzyV-Zc9Q0OVtDvR1biJmNI",
Vote: bundletypes.VOTE_TYPE_ABSTAIN,
})

// ASSERT
bundleProposal, _ := s.App().BundlesKeeper.GetBundleProposal(s.Ctx(), 0)

Expect(bundleProposal.VotersValid).NotTo(ContainElement(i.STAKER_1))
Expect(bundleProposal.VotersInvalid).NotTo(ContainElement(i.STAKER_1))
Expect(bundleProposal.VotersAbstain).To(ContainElement(i.STAKER_1))
})

It("Try to vote abstain on proposal again", func() {
// ARRANGE
s.RunTxBundlesSuccess(&bundletypes.MsgVoteBundleProposal{
Expand Down

0 comments on commit 50aba52

Please sign in to comment.