diff --git a/testutil/integration/checks.go b/testutil/integration/checks.go index a2ac0a4b..9c4f57bd 100644 --- a/testutil/integration/checks.go +++ b/testutil/integration/checks.go @@ -123,7 +123,7 @@ func (suite *KeeperTestSuite) VerifyPoolQueries() { Expect(poolByIdQuery.Pool.TotalDelegation).To(Equal(totalDelegationState)) // test stakers by pool - valaccounts := suite.App().StakersKeeper.GetAllValaccountsOfPool(suite.Ctx(), poolsState[i].Id) + valaccounts := suite.App().StakersKeeper.GetAllPoolAccountsOfPool(suite.Ctx(), poolsState[i].Id) stakersByPoolState := make([]querytypes.FullStaker, 0) for _, valaccount := range valaccounts { @@ -474,10 +474,10 @@ func (suite *KeeperTestSuite) verifyFullStaker(fullStaker querytypes.FullStaker, for _, poolMembership := range fullStaker.Pools { poolIds[poolMembership.Pool.Id] = true - valaccount, active := suite.App().StakersKeeper.GetValaccount(suite.Ctx(), poolMembership.Pool.Id, stakerAddress) + valaccount, active := suite.App().StakersKeeper.GetPoolAccount(suite.Ctx(), stakerAddress, poolMembership.Pool.Id) Expect(active).To(BeTrue()) - Expect(poolMembership.Valaddress).To(Equal(valaccount.Valaddress)) + Expect(poolMembership.PoolAddress).To(Equal(valaccount.PoolAddress)) Expect(poolMembership.IsLeaving).To(Equal(valaccount.IsLeaving)) Expect(poolMembership.Points).To(Equal(valaccount.Points)) @@ -496,7 +496,7 @@ func (suite *KeeperTestSuite) verifyFullStaker(fullStaker querytypes.FullStaker, } // Reverse check the pool memberships - for _, valaccount := range suite.App().StakersKeeper.GetValaccountsFromStaker(suite.Ctx(), stakerAddress) { + for _, valaccount := range suite.App().StakersKeeper.GetPoolAccountsFromStaker(suite.Ctx(), stakerAddress) { Expect(poolIds[valaccount.PoolId]).To(BeTrue()) } } diff --git a/x/bundles/keeper/abci_protocol_split_test.go b/x/bundles/keeper/abci_protocol_split_test.go index e88ee831..a4649996 100644 --- a/x/bundles/keeper/abci_protocol_split_test.go +++ b/x/bundles/keeper/abci_protocol_split_test.go @@ -83,7 +83,7 @@ var _ = Describe("abci.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -93,7 +93,7 @@ var _ = Describe("abci.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -139,7 +139,7 @@ var _ = Describe("abci.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -147,7 +147,7 @@ var _ = Describe("abci.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -155,7 +155,7 @@ var _ = Describe("abci.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_0_B, + PoolAddress: i.VALADDRESS_0_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -163,7 +163,7 @@ var _ = Describe("abci.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 1, - Valaddress: i.VALADDRESS_1_B, + PoolAddress: i.VALADDRESS_1_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -206,7 +206,7 @@ var _ = Describe("abci.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -216,7 +216,7 @@ var _ = Describe("abci.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) diff --git a/x/bundles/keeper/keeper_suite_dropped_bundles_test.go b/x/bundles/keeper/keeper_suite_dropped_bundles_test.go index 0dd6d57b..3dc0041a 100644 --- a/x/bundles/keeper/keeper_suite_dropped_bundles_test.go +++ b/x/bundles/keeper/keeper_suite_dropped_bundles_test.go @@ -70,7 +70,7 @@ var _ = Describe("dropped bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -80,7 +80,7 @@ var _ = Describe("dropped bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -111,7 +111,7 @@ var _ = Describe("dropped bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -171,10 +171,10 @@ var _ = Describe("dropped bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceValaddress := s.GetBalanceFromAddress(valaccountUploader.Valaddress) + balanceValaddress := s.GetBalanceFromAddress(valaccountUploader.PoolAddress) Expect(balanceValaddress).To(Equal(initialBalanceValaddress0)) balanceUploader := s.GetBalanceFromAddress(valaccountUploader.Staker) @@ -183,10 +183,10 @@ var _ = Describe("dropped bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), i.STAKER_0, i.STAKER_0)).To(BeEmpty()) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(Equal(uint64(1))) - balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetBalanceFromAddress(valaccountVoter.Staker) diff --git a/x/bundles/keeper/keeper_suite_funding_bundles_test.go b/x/bundles/keeper/keeper_suite_funding_bundles_test.go index 728e34c3..ee595311 100644 --- a/x/bundles/keeper/keeper_suite_funding_bundles_test.go +++ b/x/bundles/keeper/keeper_suite_funding_bundles_test.go @@ -109,7 +109,7 @@ var _ = Describe("funding bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -119,7 +119,7 @@ var _ = Describe("funding bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) diff --git a/x/bundles/keeper/keeper_suite_inflation_splitting_test.go b/x/bundles/keeper/keeper_suite_inflation_splitting_test.go index c3f3b87d..26b1ffc0 100644 --- a/x/bundles/keeper/keeper_suite_inflation_splitting_test.go +++ b/x/bundles/keeper/keeper_suite_inflation_splitting_test.go @@ -130,7 +130,7 @@ var _ = Describe("inflation splitting", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -140,7 +140,7 @@ var _ = Describe("inflation splitting", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1764,14 +1764,14 @@ var _ = Describe("inflation splitting", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_0_B, + PoolAddress: i.VALADDRESS_0_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 1, - Valaddress: i.VALADDRESS_1_B, + PoolAddress: i.VALADDRESS_1_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1922,7 +1922,7 @@ var _ = Describe("inflation splitting", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_0_B, + PoolAddress: i.VALADDRESS_0_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1930,7 +1930,7 @@ var _ = Describe("inflation splitting", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 1, - Valaddress: i.VALADDRESS_1_B, + PoolAddress: i.VALADDRESS_1_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) diff --git a/x/bundles/keeper/keeper_suite_invalid_bundles_test.go b/x/bundles/keeper/keeper_suite_invalid_bundles_test.go index 64827c21..2133969f 100644 --- a/x/bundles/keeper/keeper_suite_invalid_bundles_test.go +++ b/x/bundles/keeper/keeper_suite_invalid_bundles_test.go @@ -99,7 +99,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -109,7 +109,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -135,7 +135,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -216,7 +216,7 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - _, uploaderActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, uploaderActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(uploaderActive).To(BeFalse()) balanceValaddress := s.GetBalanceFromAddress(i.VALADDRESS_0_A) @@ -238,10 +238,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(200 * i.KYVE)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -250,10 +250,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), i.STAKER_1, i.STAKER_1)).To(BeEmpty()) // check voter 2 status - valaccountVoter, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter = s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -276,7 +276,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -286,7 +286,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -308,7 +308,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -411,7 +411,7 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - _, uploaderActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, uploaderActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(uploaderActive).To(BeFalse()) balanceValaddress := s.GetBalanceFromAddress(i.VALADDRESS_0_A) @@ -437,10 +437,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(400 * i.KYVE)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -449,10 +449,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), i.STAKER_1, i.BOB)).To(BeEmpty()) // check voter 2 status - valaccountVoter, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter = s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -475,7 +475,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -485,7 +485,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -507,7 +507,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -523,7 +523,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_3, PoolId: 0, - Valaddress: i.VALADDRESS_3_A, + PoolAddress: i.VALADDRESS_3_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -635,7 +635,7 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - _, uploaderActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, uploaderActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(uploaderActive).To(BeFalse()) balanceValaddress := s.GetBalanceFromAddress(i.VALADDRESS_0_A) @@ -669,7 +669,7 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(450 * i.KYVE)) // check voter status - _, voterActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + _, voterActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(voterActive).To(BeFalse()) balanceVoterValaddress := s.GetBalanceFromAddress(i.VALADDRESS_1_A) @@ -681,10 +681,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), i.STAKER_1, i.BOB)).To(BeEmpty()) // check voter2 status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter = s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -693,10 +693,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), i.STAKER_2, i.CHARLIE)).To(BeEmpty()) // check voter3 status - valaccountVoter, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_3) + valaccountVoter, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_3, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter = s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -719,7 +719,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.5"), }) @@ -729,7 +729,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -755,7 +755,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -836,7 +836,7 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - _, uploaderActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, uploaderActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(uploaderActive).To(BeFalse()) balanceValaddress := s.GetBalanceFromAddress(i.VALADDRESS_0_A) @@ -858,10 +858,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(200 * i.KYVE)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -870,10 +870,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), i.STAKER_1, i.STAKER_1)).To(BeEmpty()) // check voter 2 status - valaccountVoter, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter = s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -902,7 +902,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.5"), }) @@ -912,7 +912,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -938,7 +938,7 @@ var _ = Describe("invalid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1019,7 +1019,7 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - _, uploaderActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, uploaderActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(uploaderActive).To(BeFalse()) balanceValaddress := s.GetBalanceFromAddress(i.VALADDRESS_0_A) @@ -1043,10 +1043,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(200 * i.KYVE)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -1055,10 +1055,10 @@ var _ = Describe("invalid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), i.STAKER_1, i.STAKER_1)).To(BeEmpty()) // check voter 2 status - valaccountVoter, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress = s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter = s.GetBalanceFromAddress(valaccountVoter.Staker) diff --git a/x/bundles/keeper/keeper_suite_points_test.go b/x/bundles/keeper/keeper_suite_points_test.go index 0f0f23a9..b10d885c 100644 --- a/x/bundles/keeper/keeper_suite_points_test.go +++ b/x/bundles/keeper/keeper_suite_points_test.go @@ -70,7 +70,7 @@ var _ = Describe("points", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -80,7 +80,7 @@ var _ = Describe("points", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -90,7 +90,7 @@ var _ = Describe("points", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -150,7 +150,7 @@ var _ = Describe("points", Ordered, func() { }) // ASSERT - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountVoter.Points).To(Equal(uint64(1))) }) @@ -198,7 +198,7 @@ var _ = Describe("points", Ordered, func() { }) // ASSERT - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountVoter.Points).To(BeZero()) }) @@ -238,7 +238,7 @@ var _ = Describe("points", Ordered, func() { } // ASSERT - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountVoter.Points).To(Equal(uint64(3))) }) @@ -303,7 +303,7 @@ var _ = Describe("points", Ordered, func() { }) // ASSERT - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountVoter.Points).To(BeZero()) }) @@ -352,7 +352,7 @@ var _ = Describe("points", Ordered, func() { _, stakerFound := s.App().StakersKeeper.GetValidator(s.Ctx(), i.STAKER_2) Expect(stakerFound).To(BeTrue()) - _, valaccountActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + _, valaccountActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountActive).To(BeFalse()) // check if voter got slashed @@ -418,7 +418,7 @@ var _ = Describe("points", Ordered, func() { }) // ASSERT - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) // points are instantly 1 because node did not vote on this bundle, too Expect(valaccountVoter.Points).To(Equal(uint64(1))) }) @@ -472,7 +472,7 @@ var _ = Describe("points", Ordered, func() { }) // ASSERT - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) }) @@ -534,7 +534,7 @@ var _ = Describe("points", Ordered, func() { }) // ASSERT - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) // points are instantly 1 because node did not vote on this bundle, too Expect(valaccountVoter.Points).To(Equal(uint64(1))) }) diff --git a/x/bundles/keeper/keeper_suite_stakers_leave_test.go b/x/bundles/keeper/keeper_suite_stakers_leave_test.go index f42c26d1..52cd2acc 100644 --- a/x/bundles/keeper/keeper_suite_stakers_leave_test.go +++ b/x/bundles/keeper/keeper_suite_stakers_leave_test.go @@ -77,7 +77,7 @@ var _ = Describe("stakers leave", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -87,7 +87,7 @@ var _ = Describe("stakers leave", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -113,7 +113,7 @@ var _ = Describe("stakers leave", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -122,7 +122,7 @@ var _ = Describe("stakers leave", Ordered, func() { s.CommitAfterSeconds(60) // leave pool - s.App().StakersKeeper.RemoveValaccountFromPool(s.Ctx(), 0, i.STAKER_0) + s.App().StakersKeeper.RemovePoolAccountFromPool(s.Ctx(), i.STAKER_0, 0) s.CommitAfterSeconds(s.App().BundlesKeeper.GetUploadTimeout(s.Ctx())) s.CommitAfterSeconds(1) @@ -137,7 +137,7 @@ var _ = Describe("stakers leave", Ordered, func() { Expect(poolStakers).To(HaveLen(2)) Expect(poolStakers[0]).To(Equal(i.STAKER_1)) - _, valaccountActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, valaccountActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountActive).To(BeFalse()) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(200 * i.KYVE)) @@ -153,7 +153,7 @@ var _ = Describe("stakers leave", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -191,7 +191,7 @@ var _ = Describe("stakers leave", Ordered, func() { }) // leave pool - s.App().StakersKeeper.RemoveValaccountFromPool(s.Ctx(), 0, i.STAKER_0) + s.App().StakersKeeper.RemovePoolAccountFromPool(s.Ctx(), i.STAKER_0, 0) // overwrite next uploader for test purposes bundleProposal, _ := s.App().BundlesKeeper.GetBundleProposal(s.Ctx(), 0) @@ -225,7 +225,7 @@ var _ = Describe("stakers leave", Ordered, func() { Expect(poolStakers).To(HaveLen(2)) Expect(poolStakers[0]).To(Equal(i.STAKER_1)) - _, valaccountActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, valaccountActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountActive).To(BeFalse()) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(200 * i.KYVE)) @@ -264,7 +264,7 @@ var _ = Describe("stakers leave", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -302,7 +302,7 @@ var _ = Describe("stakers leave", Ordered, func() { }) // leave pool - s.App().StakersKeeper.RemoveValaccountFromPool(s.Ctx(), 0, i.STAKER_0) + s.App().StakersKeeper.RemovePoolAccountFromPool(s.Ctx(), i.STAKER_0, 0) // overwrite next uploader for test purposes bundleProposal, _ := s.App().BundlesKeeper.GetBundleProposal(s.Ctx(), 0) @@ -336,7 +336,7 @@ var _ = Describe("stakers leave", Ordered, func() { Expect(poolStakers).To(HaveLen(2)) Expect(poolStakers[0]).To(Equal(i.STAKER_1)) - _, valaccountActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, valaccountActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountActive).To(BeFalse()) // check if next uploader got slashed @@ -362,7 +362,7 @@ var _ = Describe("stakers leave", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -402,7 +402,7 @@ var _ = Describe("stakers leave", Ordered, func() { }) // leave pool - s.App().StakersKeeper.RemoveValaccountFromPool(s.Ctx(), 0, i.STAKER_1) + s.App().StakersKeeper.RemovePoolAccountFromPool(s.Ctx(), i.STAKER_1, 0) // overwrite next uploader for test purposes bundleProposal, _ := s.App().BundlesKeeper.GetBundleProposal(s.Ctx(), 0) @@ -436,7 +436,7 @@ var _ = Describe("stakers leave", Ordered, func() { Expect(poolStakers).To(HaveLen(2)) Expect(poolStakers[0]).To(Equal(i.STAKER_0)) - _, valaccountActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + _, valaccountActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountActive).To(BeFalse()) // check if voter got slashed @@ -462,7 +462,7 @@ var _ = Describe("stakers leave", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -494,7 +494,7 @@ var _ = Describe("stakers leave", Ordered, func() { initialBalanceStaker1 = s.GetBalanceFromAddress(i.STAKER_1) // leave pool - s.App().StakersKeeper.RemoveValaccountFromPool(s.Ctx(), 0, i.STAKER_1) + s.App().StakersKeeper.RemovePoolAccountFromPool(s.Ctx(), i.STAKER_1, 0) // do not vote @@ -530,7 +530,7 @@ var _ = Describe("stakers leave", Ordered, func() { Expect(poolStakers).To(HaveLen(2)) Expect(poolStakers[0]).To(Equal(i.STAKER_0)) - _, valaccountActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + _, valaccountActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountActive).To(BeFalse()) // check if voter status @@ -554,7 +554,7 @@ var _ = Describe("stakers leave", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -599,7 +599,7 @@ var _ = Describe("stakers leave", Ordered, func() { initialBalanceStaker1 = s.GetBalanceFromAddress(i.STAKER_1) // leave pool - s.App().StakersKeeper.RemoveValaccountFromPool(s.Ctx(), 0, i.STAKER_1) + s.App().StakersKeeper.RemovePoolAccountFromPool(s.Ctx(), i.STAKER_1, 0) // ACT s.RunTxBundlesSuccess(&bundletypes.MsgSubmitBundleProposal{ @@ -626,7 +626,7 @@ var _ = Describe("stakers leave", Ordered, func() { Expect(poolStakers).To(HaveLen(2)) Expect(poolStakers[0]).To(Equal(i.STAKER_0)) - _, valaccountActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + _, valaccountActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountActive).To(BeFalse()) // check if voter not got slashed diff --git a/x/bundles/keeper/keeper_suite_valid_bundles_test.go b/x/bundles/keeper/keeper_suite_valid_bundles_test.go index 69804fec..74ff2b66 100644 --- a/x/bundles/keeper/keeper_suite_valid_bundles_test.go +++ b/x/bundles/keeper/keeper_suite_valid_bundles_test.go @@ -122,7 +122,7 @@ var _ = Describe("valid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -132,7 +132,7 @@ var _ = Describe("valid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -249,17 +249,17 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetCoinsFromAddress(valaccountVoter.Staker) @@ -395,17 +395,17 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetCoinsFromAddress(valaccountVoter.Staker) @@ -459,7 +459,7 @@ var _ = Describe("valid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -561,17 +561,17 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccountVoter.Points).To(Equal(uint64(1))) - balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetCoinsFromAddress(valaccountVoter.Staker) @@ -625,7 +625,7 @@ var _ = Describe("valid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -735,17 +735,17 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetCoinsFromAddress(valaccountVoter.Staker) @@ -799,7 +799,7 @@ var _ = Describe("valid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -909,10 +909,10 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // calculate voter slashes @@ -926,7 +926,7 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(800 * i.KYVE)) // check voter status - _, voterActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + _, voterActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(voterActive).To(BeFalse()) balanceVoterValaddress := s.GetCoinsFromAddress(i.VALADDRESS_2_A) @@ -973,7 +973,7 @@ var _ = Describe("valid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -990,7 +990,7 @@ var _ = Describe("valid bundles", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_3, PoolId: 0, - Valaddress: i.VALADDRESS_3_A, + PoolAddress: i.VALADDRESS_3_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1111,10 +1111,10 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // calculate voter slashes (due to maximum vote power only 200 kyve out of 400 where at risk for slashing) @@ -1128,7 +1128,7 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(300 * i.KYVE)) // check voter status - _, voterActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + _, voterActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(voterActive).To(BeFalse()) balanceVoterValaddress := s.GetCoinsFromAddress(i.VALADDRESS_2_A) @@ -1266,17 +1266,17 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetCoinsFromAddress(valaccountVoter.Staker) @@ -1405,17 +1405,17 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetCoinsFromAddress(valaccountVoter.Staker) @@ -1574,17 +1574,17 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetCoinsFromAddress(valaccountVoter.Staker) @@ -1737,17 +1737,17 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetCoinsFromAddress(valaccountVoter.Staker) @@ -1932,17 +1932,17 @@ var _ = Describe("valid bundles", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetCoinsFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetCoinsFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetCoinsFromAddress(valaccountVoter.Staker) diff --git a/x/bundles/keeper/keeper_suite_zero_delegation_test.go b/x/bundles/keeper/keeper_suite_zero_delegation_test.go index 7a8585f5..a466e400 100644 --- a/x/bundles/keeper/keeper_suite_zero_delegation_test.go +++ b/x/bundles/keeper/keeper_suite_zero_delegation_test.go @@ -93,7 +93,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -103,7 +103,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -144,7 +144,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -194,7 +194,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -204,7 +204,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -237,7 +237,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -302,7 +302,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -313,7 +313,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -324,7 +324,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -434,19 +434,19 @@ var _ = Describe("zero delegation", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - valaccountUploader, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccountUploader, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccountUploader.Points).To(BeZero()) - balanceUploaderValaddress := s.GetBalanceFromAddress(valaccountUploader.Valaddress) + balanceUploaderValaddress := s.GetBalanceFromAddress(valaccountUploader.PoolAddress) Expect(balanceUploaderValaddress).To(Equal(initialBalanceValaddress0)) balanceUploader := s.GetBalanceFromAddress(valaccountUploader.Staker) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -480,7 +480,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -491,7 +491,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -502,7 +502,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -601,7 +601,7 @@ var _ = Describe("zero delegation", Ordered, func() { Expect(bundleProposal.VotersAbstain).To(BeEmpty()) // check uploader status - _, uploaderActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, uploaderActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(uploaderActive).To(BeFalse()) balanceValaddress := s.GetBalanceFromAddress(i.VALADDRESS_0_A) @@ -622,10 +622,10 @@ var _ = Describe("zero delegation", Ordered, func() { Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(200*i.KYVE - slashAmount)) // check voter status - valaccountVoter, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccountVoter, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountVoter.Points).To(BeZero()) - balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.Valaddress) + balanceVoterValaddress := s.GetBalanceFromAddress(valaccountVoter.PoolAddress) Expect(balanceVoterValaddress).To(Equal(initialBalanceValaddress1)) balanceVoter := s.GetBalanceFromAddress(valaccountVoter.Staker) @@ -648,7 +648,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -659,7 +659,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -670,7 +670,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -749,7 +749,7 @@ var _ = Describe("zero delegation", Ordered, func() { _, stakerFound := s.App().StakersKeeper.GetValidator(s.Ctx(), i.STAKER_1) Expect(stakerFound).To(BeTrue()) - _, valaccountActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + _, valaccountActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccountActive).To(BeFalse()) // check if voter got slashed @@ -766,7 +766,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -776,7 +776,7 @@ var _ = Describe("zero delegation", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) diff --git a/x/bundles/keeper/logic_bundles_test.go b/x/bundles/keeper/logic_bundles_test.go index 64e248ab..c333dfc9 100644 --- a/x/bundles/keeper/logic_bundles_test.go +++ b/x/bundles/keeper/logic_bundles_test.go @@ -105,7 +105,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -116,7 +116,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -136,7 +136,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -147,7 +147,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -172,7 +172,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -183,7 +183,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -221,7 +221,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -232,7 +232,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -270,7 +270,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -281,7 +281,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -292,7 +292,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -332,7 +332,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -343,7 +343,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -354,7 +354,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -394,7 +394,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -414,7 +414,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -425,7 +425,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -463,7 +463,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -474,7 +474,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -510,7 +510,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -521,7 +521,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -567,7 +567,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -578,7 +578,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -624,7 +624,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -635,7 +635,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -680,7 +680,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -691,7 +691,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -745,7 +745,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -756,7 +756,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -810,7 +810,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -821,7 +821,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -869,7 +869,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -880,7 +880,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -909,7 +909,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -920,7 +920,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -949,7 +949,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -960,7 +960,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -992,7 +992,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -1003,7 +1003,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -1032,7 +1032,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -1043,7 +1043,7 @@ var _ = Describe("logic_bundles.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), diff --git a/x/bundles/keeper/logic_end_block_handle_upload_timeout_test.go b/x/bundles/keeper/logic_end_block_handle_upload_timeout_test.go index 847aa16d..bd5d8976 100644 --- a/x/bundles/keeper/logic_end_block_handle_upload_timeout_test.go +++ b/x/bundles/keeper/logic_end_block_handle_upload_timeout_test.go @@ -97,7 +97,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -105,7 +105,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -391,7 +391,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { Expect(poolStakers).To(HaveLen(2)) // check if next uploader received a point - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Points).To(Equal(uint64(1))) _, found := s.App().StakersKeeper.GetValidator(s.Ctx(), i.STAKER_0) @@ -561,11 +561,11 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { Expect(poolStakers).To(HaveLen(2)) // check that staker 0 has no points - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Points).To(Equal(uint64(0))) // check that staker 1 (next uploader) received a point for not uploading - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccount.Points).To(Equal(uint64(1))) // check that nobody got slashed @@ -621,11 +621,11 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { Expect(poolStakers).To(ContainElements(i.STAKER_0, i.STAKER_1)) // check that staker 0 (uploader) has no points - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Points).To(Equal(uint64(0))) // check that staker 1 received a point for not voting - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccount.Points).To(Equal(uint64(1))) // check that nobody got slashed @@ -650,7 +650,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -715,11 +715,11 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { Expect(poolStakers).To(ContainElements(i.STAKER_1, i.STAKER_2)) // check that staker 1 (next uploader) received a point for missing the upload - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccount.Points).To(Equal(uint64(1))) // check that staker 2 has a no points - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccount.Points).To(Equal(uint64(0))) // check that staker 0 (uploader) got slashed @@ -747,7 +747,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -845,11 +845,11 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { Expect(poolStakers).To(ContainElements(i.STAKER_0, i.STAKER_1)) // check that staker 0 (uploader) has no points - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_1) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_1, 0) Expect(valaccount.Points).To(Equal(uint64(0))) // check that staker 2 has a no points - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_2) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 0) Expect(valaccount.Points).To(Equal(uint64(0))) // check that staker 0 (uploader) didn't get slashed @@ -977,7 +977,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1005,7 +1005,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { }) // remove valaccount directly from pool - s.App().StakersKeeper.RemoveValaccountFromPool(s.Ctx(), 0, i.STAKER_1) + s.App().StakersKeeper.RemovePoolAccountFromPool(s.Ctx(), i.STAKER_1, 0) // ACT s.CommitAfterSeconds(60) @@ -1043,7 +1043,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1087,7 +1087,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { }) // remove valaccount directly from pool - s.App().StakersKeeper.RemoveValaccountFromPool(s.Ctx(), 0, i.STAKER_1) + s.App().StakersKeeper.RemovePoolAccountFromPool(s.Ctx(), i.STAKER_1, 0) // ACT s.CommitAfterSeconds(s.App().BundlesKeeper.GetUploadTimeout(s.Ctx())) @@ -1131,7 +1131,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1175,7 +1175,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { }) // remove valaccount directly from pool - s.App().StakersKeeper.RemoveValaccountFromPool(s.Ctx(), 0, i.STAKER_0) + s.App().StakersKeeper.RemovePoolAccountFromPool(s.Ctx(), i.STAKER_0, 0) // ACT s.CommitAfterSeconds(s.App().BundlesKeeper.GetUploadTimeout(s.Ctx()) + 60) @@ -1239,7 +1239,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_0_B, + PoolAddress: i.VALADDRESS_0_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1247,7 +1247,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 1, - Valaddress: i.VALADDRESS_1_B, + PoolAddress: i.VALADDRESS_1_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1261,7 +1261,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 1, - Valaddress: i.VALADDRESS_2_B, + PoolAddress: i.VALADDRESS_2_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -1357,7 +1357,7 @@ var _ = Describe("logic_end_block_handle_upload_timeout.go", Ordered, func() { Expect(poolStakers).To(HaveLen(2)) // check if next uploader received a point - _, valaccountActive := s.App().StakersKeeper.GetValaccount(s.Ctx(), 1, i.STAKER_2) + _, valaccountActive := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_2, 1) Expect(valaccountActive).To(BeFalse()) _, found = s.App().StakersKeeper.GetValidator(s.Ctx(), i.STAKER_2) diff --git a/x/bundles/keeper/logic_round_robin_test.go b/x/bundles/keeper/logic_round_robin_test.go index 2cb3c442..470661fa 100644 --- a/x/bundles/keeper/logic_round_robin_test.go +++ b/x/bundles/keeper/logic_round_robin_test.go @@ -43,7 +43,7 @@ func joinDummyWithStakeFraction(s *i.KeeperTestSuite, index, kyveAmount uint64, s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.DUMMY[index], PoolId: 0, - Valaddress: i.VALDUMMY[index], + PoolAddress: i.VALDUMMY[index], Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: stakeFraction, diff --git a/x/bundles/keeper/msg_server_claim_uploader_role_test.go b/x/bundles/keeper/msg_server_claim_uploader_role_test.go index 3698692b..e1278684 100644 --- a/x/bundles/keeper/msg_server_claim_uploader_role_test.go +++ b/x/bundles/keeper/msg_server_claim_uploader_role_test.go @@ -63,7 +63,7 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -73,7 +73,7 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -206,7 +206,7 @@ var _ = Describe("msg_server_claim_uploader_role.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_0_B, + PoolAddress: i.VALADDRESS_0_B, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) 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 ef6fac03..28e10dff 100644 --- a/x/bundles/keeper/msg_server_skip_uploader_role_test.go +++ b/x/bundles/keeper/msg_server_skip_uploader_role_test.go @@ -67,7 +67,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -77,7 +77,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -93,7 +93,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -176,7 +176,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() { Expect(found).To(BeFalse()) // check that no validator got a point for the second round - valaccounts := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccounts := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) for _, valaccount := range valaccounts { Expect(valaccount.Points).To(BeZero()) } @@ -248,7 +248,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() { Expect(found).To(BeFalse()) // check that no validator got a point for the second round - valaccounts := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccounts := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) for _, valaccount := range valaccounts { Expect(valaccount.Points).To(BeZero()) } @@ -297,7 +297,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() { Expect(found).To(BeFalse()) // check that no validator got a point for the second round - valaccounts := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccounts := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) for _, valaccount := range valaccounts { if valaccount.Staker == i.STAKER_0 { Expect(valaccount.Points).To(BeZero()) @@ -364,7 +364,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() { Expect(finalizedBundle.Uploader).To(Equal(i.STAKER_0)) // check if no validator got a point for the second round - valaccounts := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccounts := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) for _, valaccount := range valaccounts { Expect(valaccount.Points).To(BeZero()) } @@ -423,7 +423,7 @@ var _ = Describe("msg_server_skip_uploader_role.go", Ordered, func() { Expect(found).To(BeFalse()) // check that no validator got a point - valaccounts := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccounts := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) for _, valaccount := range valaccounts { Expect(valaccount.Points).To(BeZero()) } diff --git a/x/bundles/keeper/msg_server_submit_bundle_proposal_test.go b/x/bundles/keeper/msg_server_submit_bundle_proposal_test.go index 22299c1d..b3da62bd 100644 --- a/x/bundles/keeper/msg_server_submit_bundle_proposal_test.go +++ b/x/bundles/keeper/msg_server_submit_bundle_proposal_test.go @@ -73,7 +73,7 @@ var _ = Describe("msg_server_submit_bundle_proposal.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -83,7 +83,7 @@ var _ = Describe("msg_server_submit_bundle_proposal.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) diff --git a/x/bundles/keeper/msg_server_vote_bundle_proposal_test.go b/x/bundles/keeper/msg_server_vote_bundle_proposal_test.go index a21c2480..ac443b9b 100644 --- a/x/bundles/keeper/msg_server_vote_bundle_proposal_test.go +++ b/x/bundles/keeper/msg_server_vote_bundle_proposal_test.go @@ -71,7 +71,7 @@ var _ = Describe("msg_server_vote_bundle_proposal.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -81,7 +81,7 @@ var _ = Describe("msg_server_vote_bundle_proposal.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -222,7 +222,7 @@ var _ = Describe("msg_server_vote_bundle_proposal.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) diff --git a/x/delegation/keeper/msg_server_redelegate_test.go b/x/delegation/keeper/msg_server_redelegate_test.go index 1be69e61..76a1e562 100644 --- a/x/delegation/keeper/msg_server_redelegate_test.go +++ b/x/delegation/keeper/msg_server_redelegate_test.go @@ -73,7 +73,7 @@ var _ = Describe("Delegation - Redelegation", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.BOB, PoolId: 1, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), diff --git a/x/delegation/keeper/msg_server_undelegate_test.go b/x/delegation/keeper/msg_server_undelegate_test.go index 4715def4..02c99b56 100644 --- a/x/delegation/keeper/msg_server_undelegate_test.go +++ b/x/delegation/keeper/msg_server_undelegate_test.go @@ -79,7 +79,7 @@ var _ = Describe("msg_server_undelegate.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.BOB, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), diff --git a/x/pool/keeper/msg_server_disable_pool_test.go b/x/pool/keeper/msg_server_disable_pool_test.go index 5c3a9fec..7f00f274 100644 --- a/x/pool/keeper/msg_server_disable_pool_test.go +++ b/x/pool/keeper/msg_server_disable_pool_test.go @@ -370,7 +370,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -381,7 +381,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -392,7 +392,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { Id: 0, } - Expect(s.App().StakersKeeper.GetAllValaccounts(s.Ctx())).To(HaveLen(2)) + Expect(s.App().StakersKeeper.GetAllPoolAccounts(s.Ctx())).To(HaveLen(2)) Expect(s.App().StakersKeeper.GetActiveStakers(s.Ctx())).To(HaveLen(2)) p, v := BuildGovernanceTxs(s, []sdk.Msg{msgFirstPool}) @@ -412,7 +412,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { // ASSERT proposal, _ := s.App().GovKeeper.Proposals.Get(s.Ctx(), 1) - Expect(s.App().StakersKeeper.GetAllValaccounts(s.Ctx())).To(HaveLen(0)) + Expect(s.App().StakersKeeper.GetAllPoolAccounts(s.Ctx())).To(HaveLen(0)) Expect(s.App().StakersKeeper.GetActiveStakers(s.Ctx())).To(HaveLen(0)) firstPool, _ := s.App().PoolKeeper.GetPool(s.Ctx(), 0) @@ -436,7 +436,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -445,7 +445,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -456,7 +456,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -467,7 +467,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { Id: 0, } - Expect(s.App().StakersKeeper.GetAllValaccounts(s.Ctx())).To(HaveLen(3)) + Expect(s.App().StakersKeeper.GetAllPoolAccounts(s.Ctx())).To(HaveLen(3)) Expect(s.App().StakersKeeper.GetActiveStakers(s.Ctx())).To(HaveLen(2)) p, v := BuildGovernanceTxs(s, []sdk.Msg{msgFirstPool}) @@ -487,7 +487,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { // ASSERT proposal, _ := s.App().GovKeeper.Proposals.Get(s.Ctx(), 1) - Expect(s.App().StakersKeeper.GetAllValaccounts(s.Ctx())).To(HaveLen(1)) + Expect(s.App().StakersKeeper.GetAllPoolAccounts(s.Ctx())).To(HaveLen(1)) Expect(s.App().StakersKeeper.GetActiveStakers(s.Ctx())).To(HaveLen(1)) firstPool, _ := s.App().PoolKeeper.GetPool(s.Ctx(), 0) @@ -511,7 +511,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -522,7 +522,7 @@ var _ = Describe("msg_server_disable_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), diff --git a/x/query/keeper/grpc_account_redelegation_test.go b/x/query/keeper/grpc_account_redelegation_test.go index 4b2a0f01..cdab5baf 100644 --- a/x/query/keeper/grpc_account_redelegation_test.go +++ b/x/query/keeper/grpc_account_redelegation_test.go @@ -53,7 +53,7 @@ var _ = Describe("grpc_account_redelegation.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), diff --git a/x/query/keeper/grpc_query_can_propose_test.go b/x/query/keeper/grpc_query_can_propose_test.go index ddbb7d9f..0f2e44c3 100644 --- a/x/query/keeper/grpc_query_can_propose_test.go +++ b/x/query/keeper/grpc_query_can_propose_test.go @@ -70,7 +70,7 @@ var _ = Describe("grpc_query_can_propose.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -81,7 +81,7 @@ var _ = Describe("grpc_query_can_propose.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), diff --git a/x/query/keeper/grpc_query_can_validate_test.go b/x/query/keeper/grpc_query_can_validate_test.go index 4900c805..c957a794 100644 --- a/x/query/keeper/grpc_query_can_validate_test.go +++ b/x/query/keeper/grpc_query_can_validate_test.go @@ -47,7 +47,7 @@ var _ = Describe("grpc_query_can_validate.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -58,7 +58,7 @@ var _ = Describe("grpc_query_can_validate.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 1, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -72,8 +72,8 @@ var _ = Describe("grpc_query_can_validate.go", Ordered, func() { It("Call can validate if pool does not exist", func() { // ACT canValidate, err := s.App().QueryKeeper.CanValidate(s.Ctx(), &querytypes.QueryCanValidateRequest{ - PoolId: 2, - Valaddress: i.VALADDRESS_0_A, + PoolId: 2, + PoolAddress: i.VALADDRESS_0_A, }) // ASSERT @@ -86,8 +86,8 @@ var _ = Describe("grpc_query_can_validate.go", Ordered, func() { It("Call can validate if valaddress does not exist", func() { // ACT canValidate, err := s.App().QueryKeeper.CanValidate(s.Ctx(), &querytypes.QueryCanValidateRequest{ - PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolId: 0, + PoolAddress: i.VALADDRESS_2_A, }) // ASSERT @@ -100,8 +100,8 @@ var _ = Describe("grpc_query_can_validate.go", Ordered, func() { It("Call can validate with a valaddress which belongs to another pool", func() { // ACT canValidate, err := s.App().QueryKeeper.CanValidate(s.Ctx(), &querytypes.QueryCanValidateRequest{ - PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolId: 0, + PoolAddress: i.VALADDRESS_1_A, }) // ASSERT @@ -114,8 +114,8 @@ var _ = Describe("grpc_query_can_validate.go", Ordered, func() { It("Call can validate with a valid valaddress", func() { // ACT canValidate, err := s.App().QueryKeeper.CanValidate(s.Ctx(), &querytypes.QueryCanValidateRequest{ - PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolId: 0, + PoolAddress: i.VALADDRESS_0_A, }) // ASSERT diff --git a/x/query/keeper/grpc_query_can_vote_test.go b/x/query/keeper/grpc_query_can_vote_test.go index 6502a75a..38b47805 100644 --- a/x/query/keeper/grpc_query_can_vote_test.go +++ b/x/query/keeper/grpc_query_can_vote_test.go @@ -71,7 +71,7 @@ var _ = Describe("grpc_query_can_vote.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -82,7 +82,7 @@ var _ = Describe("grpc_query_can_vote.go", Ordered, func() { s.RunTxStakersSuccess(&stakertypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), diff --git a/x/stakers/keeper/keeper_suite_effective_stake_test.go b/x/stakers/keeper/keeper_suite_effective_stake_test.go index 4fdc412c..c6169526 100644 --- a/x/stakers/keeper/keeper_suite_effective_stake_test.go +++ b/x/stakers/keeper/keeper_suite_effective_stake_test.go @@ -63,7 +63,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -73,7 +73,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -83,7 +83,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -107,7 +107,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -117,7 +117,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -127,7 +127,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -151,7 +151,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -161,7 +161,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -171,7 +171,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -195,7 +195,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -205,7 +205,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -215,7 +215,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -233,7 +233,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -243,7 +243,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -253,7 +253,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -275,7 +275,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -285,7 +285,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -295,7 +295,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -315,7 +315,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -325,7 +325,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -335,7 +335,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -355,7 +355,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -375,7 +375,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -385,7 +385,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.5"), @@ -395,7 +395,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.2"), @@ -419,7 +419,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.5"), @@ -429,7 +429,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.9"), @@ -439,7 +439,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.2"), @@ -463,7 +463,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.8"), @@ -473,7 +473,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.7"), @@ -483,7 +483,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.2"), @@ -505,7 +505,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -515,7 +515,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0"), @@ -525,7 +525,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.5"), @@ -547,7 +547,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0"), @@ -557,7 +557,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0"), @@ -567,7 +567,7 @@ var _ = Describe("keeper_suite_effective_stake_test.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_2, PoolId: 0, - Valaddress: i.VALADDRESS_2_A, + PoolAddress: i.VALADDRESS_2_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0"), diff --git a/x/stakers/keeper/msg_server_join_pool_test.go b/x/stakers/keeper/msg_server_join_pool_test.go index e5998dff..7fa063c1 100644 --- a/x/stakers/keeper/msg_server_join_pool_test.go +++ b/x/stakers/keeper/msg_server_join_pool_test.go @@ -86,7 +86,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { It("Test if a newly created staker is participating in no pools yet", func() { // ASSERT - valaccounts := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccounts := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccounts).To(HaveLen(0)) }) @@ -95,7 +95,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -108,21 +108,21 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { Expect(initialBalanceStaker0 - balanceAfterStaker0).To(Equal(100 * i.KYVE)) Expect(balanceAfterValaddress0 - initialBalanceValaddress0).To(Equal(100 * i.KYVE)) - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(BeZero()) - Expect(valaccount.Valaddress).To(Equal(i.VALADDRESS_0_A)) + Expect(valaccount.PoolAddress).To(Equal(i.VALADDRESS_0_A)) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeFalse()) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(1)) @@ -153,7 +153,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { _, err := s.RunTx(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -168,15 +168,15 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { Expect(initialBalanceStaker0 - balanceAfterStaker0).To(Equal(0 * i.KYVE)) Expect(balanceAfterValaddress0 - initialBalanceValaddress0).To(Equal(0 * i.KYVE)) - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(0)) - _, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 1, i.STAKER_0) + _, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 1) Expect(active).To(BeFalse()) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 1) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 1) Expect(valaccountsOfPool).To(HaveLen(0)) @@ -195,7 +195,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -205,7 +205,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 0 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -218,21 +218,21 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { Expect(initialBalanceStaker0 - balanceAfterStaker0).To(BeZero()) Expect(balanceAfterValaddress0 - initialBalanceValaddress0).To(BeZero()) - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(BeZero()) - Expect(valaccount.Valaddress).To(Equal(i.VALADDRESS_0_A)) + Expect(valaccount.PoolAddress).To(Equal(i.VALADDRESS_0_A)) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeFalse()) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(2)) @@ -248,7 +248,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -265,21 +265,21 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { )) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(BeZero()) - Expect(valaccount.Valaddress).To(Equal(i.VALADDRESS_0_A)) + Expect(valaccount.PoolAddress).To(Equal(i.VALADDRESS_0_A)) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeFalse()) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(1)) @@ -296,7 +296,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -306,14 +306,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) }) @@ -323,14 +323,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.STAKER_0, + PoolAddress: i.STAKER_0, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(BeEmpty()) }) @@ -340,7 +340,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -350,14 +350,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) }) @@ -367,7 +367,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -386,14 +386,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) }) @@ -413,7 +413,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 1, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -423,14 +423,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) }) @@ -439,7 +439,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -451,14 +451,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_1) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_1) Expect(valaccountsOfStaker).To(BeEmpty()) }) @@ -467,7 +467,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -486,13 +486,13 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(2)) }) @@ -501,14 +501,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: "", + PoolAddress: "", Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(BeEmpty()) }) @@ -517,28 +517,28 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(BeEmpty()) }) It("Try to join pool with empty stake fraction", func() { // ACT s.RunTxStakersError(&stakerstypes.MsgJoinPool{ - Creator: i.STAKER_0, - PoolId: 0, - Valaddress: i.VALADDRESS_0_A, - Amount: 100 * i.KYVE, - Commission: math.LegacyMustNewDecFromStr("0.1"), + Creator: i.STAKER_0, + PoolId: 0, + PoolAddress: i.VALADDRESS_0_A, + Amount: 100 * i.KYVE, + Commission: math.LegacyMustNewDecFromStr("0.1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(BeEmpty()) }) @@ -547,7 +547,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: "kyve1dx0nvx7y9d44jvr2dr6r2p636jea3f9827rn0x", + PoolAddress: "kyve1dx0nvx7y9d44jvr2dr6r2p636jea3f9827rn0x", Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -560,21 +560,21 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { Expect(initialBalanceStaker0 - balanceAfterStaker0).To(Equal(100 * i.KYVE)) Expect(balanceAfterUnknown).To(Equal(100 * i.KYVE)) - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(BeZero()) - Expect(valaccount.Valaddress).To(Equal("kyve1dx0nvx7y9d44jvr2dr6r2p636jea3f9827rn0x")) + Expect(valaccount.PoolAddress).To(Equal("kyve1dx0nvx7y9d44jvr2dr6r2p636jea3f9827rn0x")) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeFalse()) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(1)) @@ -590,7 +590,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: "kyve1dx0nvx7y9d44jvr2dr6r2p636jea3f9827rn0x", + PoolAddress: "kyve1dx0nvx7y9d44jvr2dr6r2p636jea3f9827rn0x", Amount: 0 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -603,21 +603,21 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { Expect(initialBalanceStaker0 - balanceAfterStaker0).To(BeZero()) Expect(balanceAfterUnknown).To(BeZero()) - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(BeZero()) - Expect(valaccount.Valaddress).To(Equal("kyve1dx0nvx7y9d44jvr2dr6r2p636jea3f9827rn0x")) + Expect(valaccount.PoolAddress).To(Equal("kyve1dx0nvx7y9d44jvr2dr6r2p636jea3f9827rn0x")) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeFalse()) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(1)) @@ -633,14 +633,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: "invalid_valaddress", + PoolAddress: "invalid_valaddress", Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(BeEmpty()) }) @@ -650,14 +650,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: "invalid_valaddress", + PoolAddress: "invalid_valaddress", Amount: initialBalanceStaker0 + 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.ALICE) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.ALICE) Expect(valaccountsOfStaker).To(BeEmpty()) }) @@ -669,7 +669,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -680,7 +680,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.DUMMY[k], PoolId: 0, - Valaddress: i.VALDUMMY[k], + PoolAddress: i.VALDUMMY[k], Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -696,7 +696,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -714,7 +714,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -725,7 +725,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.DUMMY[k], PoolId: 0, - Valaddress: i.VALDUMMY[k], + PoolAddress: i.VALDUMMY[k], Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -741,7 +741,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -760,7 +760,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 1 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -771,7 +771,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.DUMMY[k], PoolId: 0, - Valaddress: i.VALDUMMY[k], + PoolAddress: i.VALDUMMY[k], Amount: 1 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -793,7 +793,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -812,7 +812,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -823,7 +823,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.DUMMY[k], PoolId: 0, - Valaddress: i.VALDUMMY[k], + PoolAddress: i.VALDUMMY[k], Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -839,7 +839,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 1, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -858,7 +858,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 1 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -869,7 +869,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.DUMMY[k], PoolId: 0, - Valaddress: i.VALDUMMY[k], + PoolAddress: i.VALDUMMY[k], Amount: 1 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -891,7 +891,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersError(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 0, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -908,7 +908,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -923,14 +923,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetLeavePoolTime(s.Ctx())) s.CommitAfterSeconds(1) - _, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeFalse()) // ACT s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 50 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.2"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -943,23 +943,23 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { Expect(initialBalanceStaker0 - balanceAfterStaker0).To(Equal(150 * i.KYVE)) Expect(balanceAfterValaddress0 - initialBalanceValaddress0).To(Equal(150 * i.KYVE)) - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(BeZero()) - Expect(valaccount.Valaddress).To(Equal(i.VALADDRESS_0_A)) + Expect(valaccount.PoolAddress).To(Equal(i.VALADDRESS_0_A)) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeFalse()) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.2"))) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("1"))) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(1)) @@ -976,7 +976,7 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -991,14 +991,14 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetLeavePoolTime(s.Ctx())) s.CommitAfterSeconds(1) - _, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + _, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeFalse()) // ACT s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_B, + PoolAddress: i.VALADDRESS_0_B, Amount: 50 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.2"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -1013,23 +1013,23 @@ var _ = Describe("msg_server_join_pool.go", Ordered, func() { Expect(balanceAfterValaddress0 - initialBalanceValaddress0).To(Equal(100 * i.KYVE)) Expect(balanceAfterValaddress1 - initialBalanceValaddress1).To(Equal(50 * i.KYVE)) - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(BeZero()) - Expect(valaccount.Valaddress).To(Equal(i.VALADDRESS_0_B)) + Expect(valaccount.PoolAddress).To(Equal(i.VALADDRESS_0_B)) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeFalse()) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.2"))) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("1"))) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(1)) diff --git a/x/stakers/keeper/msg_server_leave_pool_test.go b/x/stakers/keeper/msg_server_leave_pool_test.go index 045fdc7c..b18ec6fb 100644 --- a/x/stakers/keeper/msg_server_leave_pool_test.go +++ b/x/stakers/keeper/msg_server_leave_pool_test.go @@ -49,7 +49,7 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -68,23 +68,23 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(BeZero()) - Expect(valaccount.Valaddress).To(Equal(i.VALADDRESS_0_A)) + Expect(valaccount.PoolAddress).To(Equal(i.VALADDRESS_0_A)) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeTrue()) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("1"))) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(1)) @@ -100,15 +100,15 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetLeavePoolTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccountsOfStaker = s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker = s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(BeEmpty()) - valaccount, active = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeFalse()) - valaccountsOfPool = s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool = s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(BeEmpty()) @@ -127,7 +127,7 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_1, PoolId: 0, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -141,23 +141,23 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(BeZero()) - Expect(valaccount.Valaddress).To(Equal(i.VALADDRESS_0_A)) + Expect(valaccount.PoolAddress).To(Equal(i.VALADDRESS_0_A)) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeTrue()) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("1"))) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(2)) @@ -173,15 +173,15 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetLeavePoolTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccountsOfStaker = s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker = s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(BeEmpty()) - valaccount, active = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, active = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(active).To(BeFalse()) - valaccountsOfPool = s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 0) + valaccountsOfPool = s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 0) Expect(valaccountsOfPool).To(HaveLen(1)) @@ -208,14 +208,14 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) // wait for leave pool s.CommitAfterSeconds(s.App().StakersKeeper.GetLeavePoolTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccountsOfStaker = s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker = s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(BeEmpty()) }) @@ -233,7 +233,7 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_1_A, + PoolAddress: i.VALADDRESS_1_A, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), }) @@ -246,23 +246,23 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(2)) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 1, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 1) Expect(active).To(BeTrue()) Expect(valaccount.Staker).To(Equal(i.STAKER_0)) Expect(valaccount.PoolId).To(Equal(uint64(1))) - Expect(valaccount.Valaddress).To(Equal(i.VALADDRESS_1_A)) + Expect(valaccount.PoolAddress).To(Equal(i.VALADDRESS_1_A)) Expect(valaccount.Points).To(BeZero()) Expect(valaccount.IsLeaving).To(BeTrue()) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("1"))) - valaccountsOfPool := s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 1) + valaccountsOfPool := s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 1) Expect(valaccountsOfPool).To(HaveLen(1)) @@ -276,15 +276,15 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetLeavePoolTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccountsOfStaker = s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_0) + valaccountsOfStaker = s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_0) Expect(valaccountsOfStaker).To(HaveLen(1)) - valaccount, active = s.App().StakersKeeper.GetValaccount(s.Ctx(), 1, i.STAKER_0) + valaccount, active = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 1) Expect(active).To(BeFalse()) - valaccountsOfPool = s.App().StakersKeeper.GetAllValaccountsOfPool(s.Ctx(), 1) + valaccountsOfPool = s.App().StakersKeeper.GetAllPoolAccountsOfPool(s.Ctx(), 1) Expect(valaccountsOfPool).To(BeEmpty()) @@ -307,17 +307,17 @@ var _ = Describe("msg_server_leave_pool.go", Ordered, func() { }) // ASSERT - valaccountsOfStaker := s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_1) + valaccountsOfStaker := s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_1) Expect(valaccountsOfStaker).To(BeEmpty()) // wait for leave pool s.CommitAfterSeconds(s.App().StakersKeeper.GetLeavePoolTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccountsOfStaker = s.App().StakersKeeper.GetValaccountsFromStaker(s.Ctx(), i.STAKER_1) + valaccountsOfStaker = s.App().StakersKeeper.GetPoolAccountsFromStaker(s.Ctx(), i.STAKER_1) Expect(valaccountsOfStaker).To(BeEmpty()) - valaccount, active := s.App().StakersKeeper.GetValaccount(s.Ctx(), 1, i.STAKER_0) + valaccount, active := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 1) Expect(active).To(BeFalse()) diff --git a/x/stakers/keeper/msg_server_update_commission_test.go b/x/stakers/keeper/msg_server_update_commission_test.go index 89dac8e5..9eb9af4a 100644 --- a/x/stakers/keeper/msg_server_update_commission_test.go +++ b/x/stakers/keeper/msg_server_update_commission_test.go @@ -50,7 +50,7 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -63,7 +63,7 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { It("Get the default commission from a newly joined pool", func() { // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) }) @@ -77,14 +77,14 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) // wait for update s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.5"))) }) @@ -98,14 +98,14 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) // wait for update s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyZeroDec())) }) @@ -119,14 +119,14 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) // wait for update s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyOneDec())) }) @@ -140,7 +140,7 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) }) @@ -154,7 +154,7 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) }) @@ -182,14 +182,14 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) // wait for update s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.3"))) }) @@ -215,14 +215,14 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) // wait for update s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) }) @@ -240,7 +240,7 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_0_B, + PoolAddress: i.VALADDRESS_0_B, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("1"), @@ -262,20 +262,20 @@ var _ = Describe("msg_server_update_commission.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount0, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount0, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount0.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) - valaccount1, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 1, i.STAKER_0) + valaccount1, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 1) Expect(valaccount1.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) // wait for update s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount0, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount0, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount0.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.5"))) - valaccount1, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 1, i.STAKER_0) + valaccount1, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 1) Expect(valaccount1.Commission).To(Equal(math.LegacyMustNewDecFromStr("0.5"))) }) }) diff --git a/x/stakers/keeper/msg_server_update_stake_fraction_test.go b/x/stakers/keeper/msg_server_update_stake_fraction_test.go index 9e266a33..c4327ba4 100644 --- a/x/stakers/keeper/msg_server_update_stake_fraction_test.go +++ b/x/stakers/keeper/msg_server_update_stake_fraction_test.go @@ -57,7 +57,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 0, - Valaddress: i.VALADDRESS_0_A, + PoolAddress: i.VALADDRESS_0_A, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.1"), @@ -70,7 +70,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { It("Get the default stake fraction from a newly joined pool", func() { // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(10 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(10 * i.KYVE)) @@ -86,7 +86,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.5"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(50 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(50 * i.KYVE)) @@ -102,7 +102,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(10 * i.KYVE)) @@ -110,7 +110,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetStakeFractionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(BeZero()) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(BeZero()) @@ -126,7 +126,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(10 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(10 * i.KYVE)) @@ -135,7 +135,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetStakeFractionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.01"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(1 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(1 * i.KYVE)) @@ -151,7 +151,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(100 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(100 * i.KYVE)) @@ -167,7 +167,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(10 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(10 * i.KYVE)) @@ -183,7 +183,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(10 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(10 * i.KYVE)) @@ -199,7 +199,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(10 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(10 * i.KYVE)) @@ -222,7 +222,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.2"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(20 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(20 * i.KYVE)) @@ -231,7 +231,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.2"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(20 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(20 * i.KYVE)) @@ -254,7 +254,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(10 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(10 * i.KYVE)) @@ -263,7 +263,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.01"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(1 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(1 * i.KYVE)) @@ -277,7 +277,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { StakeFraction: math.LegacyMustNewDecFromStr("0.5"), }) - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.5"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(50 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(50 * i.KYVE)) @@ -292,7 +292,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { }) // ASSERT - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.5"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(50 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(50 * i.KYVE)) @@ -301,7 +301,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.02"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(2 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(2 * i.KYVE)) @@ -321,7 +321,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.RunTxStakersSuccess(&stakerstypes.MsgJoinPool{ Creator: i.STAKER_0, PoolId: 1, - Valaddress: i.VALADDRESS_0_B, + PoolAddress: i.VALADDRESS_0_B, Amount: 100 * i.KYVE, Commission: math.LegacyMustNewDecFromStr("0.1"), StakeFraction: math.LegacyMustNewDecFromStr("0.1"), @@ -343,12 +343,12 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.PerformValidityChecks() // ASSERT - valaccount0, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount0, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount0.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.5"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(50 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(50 * i.KYVE)) - valaccount1, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 1, i.STAKER_0) + valaccount1, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 1) Expect(valaccount1.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 1)).To(Equal(10 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 1)).To(Equal(10 * i.KYVE)) @@ -357,12 +357,12 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.CommitAfterSeconds(s.App().StakersKeeper.GetCommissionChangeTime(s.Ctx())) s.CommitAfterSeconds(1) - valaccount0, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount0, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount0.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.5"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(50 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(50 * i.KYVE)) - valaccount1, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 1, i.STAKER_0) + valaccount1, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 1) Expect(valaccount1.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.03"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 1)).To(Equal(3 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 1)).To(Equal(3 * i.KYVE)) @@ -370,7 +370,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { It("Validator stake increases while stake fraction stays the same", func() { // ARRANGE - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(10 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(10 * i.KYVE)) @@ -379,7 +379,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.SelfDelegateValidator(i.STAKER_0, 50*i.KYVE) // ASSERT - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(15 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(15 * i.KYVE)) @@ -387,7 +387,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { It("Validator stake decreases while stake fraction stays the same", func() { // ARRANGE - valaccount, _ := s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ := s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(10 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(10 * i.KYVE)) @@ -401,7 +401,7 @@ var _ = Describe("msg_server_update_stake_fraction.go", Ordered, func() { s.CommitAfterSeconds(1) // ASSERT - valaccount, _ = s.App().StakersKeeper.GetValaccount(s.Ctx(), 0, i.STAKER_0) + valaccount, _ = s.App().StakersKeeper.GetPoolAccount(s.Ctx(), i.STAKER_0, 0) Expect(valaccount.StakeFraction).To(Equal(math.LegacyMustNewDecFromStr("0.1"))) Expect(s.App().StakersKeeper.GetValidatorPoolStake(s.Ctx(), i.STAKER_0, 0)).To(Equal(5 * i.KYVE)) Expect(s.App().StakersKeeper.GetTotalStakeOfPool(s.Ctx(), 0)).To(Equal(5 * i.KYVE))