Skip to content

Commit

Permalink
test: adjusted msg_server_claim_uploader_role_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 3318a8d commit 8e3b21f
Showing 1 changed file with 23 additions and 60 deletions.
83 changes: 23 additions & 60 deletions x/bundles/keeper/msg_server_claim_uploader_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,7 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() {
},
UpgradePlan: &pooltypes.UpgradePlan{},
})
})

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

It("Try to claim uploader role without pool being funded", func() {
// ARRANGE
s.RunTxStakersSuccess(&stakertypes.MsgCreateStaker{
Creator: i.STAKER_0,
Amount: 100 * i.KYVE,
Expand All @@ -58,6 +51,25 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() {
Valaddress: i.VALADDRESS_0_A,
})

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 claim uploader role without pool being funded", func() {
// ARRANGE

// ACT
s.RunTxBundlesSuccess(&bundletypes.MsgClaimUploaderRole{
Creator: i.VALADDRESS_0_A,
Expand All @@ -80,8 +92,8 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() {

// ACT
s.RunTxBundlesError(&bundletypes.MsgClaimUploaderRole{
Creator: i.VALADDRESS_0_A,
Staker: i.STAKER_0,
Creator: i.VALADDRESS_2_A,
Staker: i.STAKER_2,
PoolId: 0,
})

Expand All @@ -98,17 +110,6 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() {
Amount: 100 * i.KYVE,
})

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

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

// ACT
s.RunTxBundlesSuccess(&bundletypes.MsgClaimUploaderRole{
Creator: i.VALADDRESS_0_A,
Expand Down Expand Up @@ -144,17 +145,6 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() {
Amount: 100 * i.KYVE,
})

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

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

// ACT
s.RunTxBundlesError(&bundletypes.MsgClaimUploaderRole{
Creator: i.VALADDRESS_1_A,
Expand Down Expand Up @@ -185,20 +175,15 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() {
UpgradePlan: &pooltypes.UpgradePlan{},
})

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

s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{
Creator: i.STAKER_0,
PoolId: 1,
Valaddress: i.VALADDRESS_0_A,
Valaddress: i.VALADDRESS_0_B,
})

// ACT
s.RunTxBundlesError(&bundletypes.MsgClaimUploaderRole{
Creator: i.VALADDRESS_0_A,
Creator: i.VALADDRESS_0_B,
Staker: i.STAKER_0,
PoolId: 0,
})
Expand All @@ -216,28 +201,6 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() {
Amount: 100 * i.KYVE,
})

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

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

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,
})

s.RunTxBundlesSuccess(&bundletypes.MsgClaimUploaderRole{
Creator: i.VALADDRESS_0_A,
Staker: i.STAKER_0,
Expand Down

0 comments on commit 8e3b21f

Please sign in to comment.