From 3eab30327331ddc62027ee8f35ee9303a6cb6daf Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Tue, 16 Jul 2024 12:36:45 +0900 Subject: [PATCH] fix build 2 --- app/app.go | 18 +++++++++--------- app/export.go | 2 +- app/upgrades/v11/upgrades_test.go | 8 +++++--- app/upgrades/v14/migrations_test.go | 7 ++++--- precompiles/distribution/integration_test.go | 5 +++-- precompiles/distribution/utils_test.go | 3 ++- testutil/integration/evmos/network/clients.go | 3 ++- testutil/staking-rewards.go | 7 ++++--- x/erc20/keeper/utils_test.go | 5 +++-- x/feemarket/keeper/utils_test.go | 2 +- x/ibc/transfer/keeper/keeper_test.go | 3 ++- x/revenue/v1/keeper/utils_test.go | 5 +++-- x/vesting/keeper/integration_test.go | 9 +++++---- x/vesting/keeper/setup_test.go | 2 +- 14 files changed, 45 insertions(+), 34 deletions(-) diff --git a/app/app.go b/app/app.go index 2890582e89..0cea72b35a 100644 --- a/app/app.go +++ b/app/app.go @@ -88,7 +88,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" @@ -123,6 +122,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/evmos/evmos/v18/app/ante" ethante "github.com/evmos/evmos/v18/app/ante/evm" "github.com/evmos/evmos/v18/app/post" @@ -160,10 +160,10 @@ import ( feemarketkeeper "github.com/evmos/evmos/v18/x/feemarket/keeper" feemarkettypes "github.com/evmos/evmos/v18/x/feemarket/types" "github.com/evmos/evmos/v18/x/incentives" - inflation "github.com/evmos/evmos/v18/x/inflation/v1" + "github.com/evmos/evmos/v18/x/inflation/v1" inflationkeeper "github.com/evmos/evmos/v18/x/inflation/v1/keeper" inflationtypes "github.com/evmos/evmos/v18/x/inflation/v1/types" - revenue "github.com/evmos/evmos/v18/x/revenue/v1" + "github.com/evmos/evmos/v18/x/revenue/v1" revenuekeeper "github.com/evmos/evmos/v18/x/revenue/v1/keeper" revenuetypes "github.com/evmos/evmos/v18/x/revenue/v1/types" "github.com/evmos/evmos/v18/x/vesting" @@ -214,7 +214,7 @@ var ( genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), bank.AppModuleBasic{}, capability.AppModuleBasic{}, - staking.AppModuleBasic{AppModuleBasic: &sdkstaking.AppModuleBasic{}}, + staking.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( []govclient.ProposalHandler{ @@ -648,12 +648,12 @@ func NewEvmos( evm.NewAppModule(app.EvmKeeper, app.AccountKeeper, app.GetSubspace(evmtypes.ModuleName)), feemarket.NewAppModule(app.FeeMarketKeeper, app.GetSubspace(feemarkettypes.ModuleName)), // Evmos app modules - inflation.NewAppModule(app.InflationKeeper, app.AccountKeeper, *app.StakingKeeper.Keeper, + inflation.NewAppModule(app.InflationKeeper, app.AccountKeeper, app.StakingKeeper, app.GetSubspace(inflationtypes.ModuleName)), erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper, app.GetSubspace(erc20types.ModuleName)), epochs.NewAppModule(appCodec, app.EpochsKeeper), - vesting.NewAppModule(app.VestingKeeper, app.AccountKeeper, app.BankKeeper, *app.StakingKeeper.Keeper), + vesting.NewAppModule(app.VestingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), revenue.NewAppModule(app.RevenueKeeper, app.AccountKeeper, app.GetSubspace(revenuetypes.ModuleName)), ) @@ -1197,7 +1197,7 @@ func (app *Evmos) setupUpgradeHandlers() { v10.UpgradeName, v10.CreateUpgradeHandler( app.mm, app.configurator, - *app.StakingKeeper.Keeper, + app.StakingKeeper, ), ) @@ -1208,7 +1208,7 @@ func (app *Evmos) setupUpgradeHandlers() { app.mm, app.configurator, app.AccountKeeper, app.BankKeeper, - *app.StakingKeeper.Keeper, + app.StakingKeeper, app.DistrKeeper, ), ) @@ -1254,7 +1254,7 @@ func (app *Evmos) setupUpgradeHandlers() { app.mm, app.configurator, app.BankKeeper, app.EvmKeeper, - *app.StakingKeeper.Keeper, + app.StakingKeeper, ), ) diff --git a/app/export.go b/app/export.go index 86c5b44c43..95716f4d3b 100644 --- a/app/export.go +++ b/app/export.go @@ -50,7 +50,7 @@ func (app *Evmos) ExportAppStateAndValidators( return servertypes.ExportedApp{}, err } - validators, err := staking.WriteValidators(ctx, app.StakingKeeper.Keeper) + validators, err := staking.WriteValidators(ctx, &app.StakingKeeper) if err != nil { return servertypes.ExportedApp{}, err } diff --git a/app/upgrades/v11/upgrades_test.go b/app/upgrades/v11/upgrades_test.go index e8cb95e0d9..49e2411025 100644 --- a/app/upgrades/v11/upgrades_test.go +++ b/app/upgrades/v11/upgrades_test.go @@ -12,13 +12,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ibctypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + "github.com/stretchr/testify/suite" + "github.com/evmos/evmos/v18/app" v11 "github.com/evmos/evmos/v18/app/upgrades/v11" "github.com/evmos/evmos/v18/crypto/ethsecp256k1" "github.com/evmos/evmos/v18/testutil" utiltx "github.com/evmos/evmos/v18/testutil/tx" feemarkettypes "github.com/evmos/evmos/v18/x/feemarket/types" - "github.com/stretchr/testify/suite" "github.com/cometbft/cometbft/crypto/tmhash" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" @@ -26,6 +27,7 @@ import ( "github.com/cometbft/cometbft/version" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/evmos/evmos/v18/utils" ) @@ -107,7 +109,7 @@ func (suite *UpgradeTestSuite) setValidators(validatorsAddr []string) { validator, err := stakingtypes.NewValidator(valAddr, suite.consKey, stakingtypes.Description{}) suite.Require().NoError(err) - validator = stakingkeeper.TestingUpdateValidator(suite.app.StakingKeeper.Keeper, suite.ctx, validator, true) + validator = stakingkeeper.TestingUpdateValidator(&suite.app.StakingKeeper, suite.ctx, validator, true) err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) suite.Require().NoError(err) @@ -253,7 +255,7 @@ func (suite *UpgradeTestSuite) TestDistributeRewards() { suite.Require().Equal(math.ZeroInt(), initialDel) if utils.IsMainnet(tc.chainID) { - v11.HandleRewardDistribution(suite.ctx, suite.app.Logger(), suite.app.BankKeeper, *suite.app.StakingKeeper.Keeper, suite.app.DistrKeeper) + v11.HandleRewardDistribution(suite.ctx, suite.app.Logger(), suite.app.BankKeeper, suite.app.StakingKeeper, suite.app.DistrKeeper) } // account not in list should NOT get rewards diff --git a/app/upgrades/v14/migrations_test.go b/app/upgrades/v14/migrations_test.go index e76d5b4602..68df2c5487 100644 --- a/app/upgrades/v14/migrations_test.go +++ b/app/upgrades/v14/migrations_test.go @@ -4,6 +4,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + v14 "github.com/evmos/evmos/v18/app/upgrades/v14" "github.com/evmos/evmos/v18/testutil" testutiltx "github.com/evmos/evmos/v18/testutil/tx" @@ -136,11 +137,11 @@ func (s *UpgradesTestSuite) TestUpdateMigrateNativeMultisigs() { expectedSharesMap[s.validators[0].OperatorAddress] = expectedSharesMap[s.validators[0].OperatorAddress].Sub(delegateShares) // Migrate strategic reserves - err = v14.MigrateNativeMultisigs(s.ctx, s.app.BankKeeper, *s.app.StakingKeeper.Keeper, newStrategicReserve.Addr, oldStrategicReservesAddrs...) + err = v14.MigrateNativeMultisigs(s.ctx, s.app.BankKeeper, s.app.StakingKeeper, newStrategicReserve.Addr, oldStrategicReservesAddrs...) s.Require().NoError(err, "failed to migrate strategic reserves") // Migrate premint wallet - err = v14.MigrateNativeMultisigs(s.ctx, s.app.BankKeeper, *s.app.StakingKeeper.Keeper, newPremintWallet.Addr, oldPremintWallet.Addr.String()) + err = v14.MigrateNativeMultisigs(s.ctx, s.app.BankKeeper, s.app.StakingKeeper, newPremintWallet.Addr, oldPremintWallet.Addr.String()) s.Require().NoError(err, "failed to migrate premint wallet") // Check that the multisigs have been updated @@ -162,7 +163,7 @@ func (s *UpgradesTestSuite) TestInstantUnbonding() { delegation, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), s.validators[0].GetOperator()) s.Require().True(found, "delegation not found") - unbondAmount, err := v14.InstantUnbonding(s.ctx, s.app.BankKeeper, *s.app.StakingKeeper.Keeper, delegation, s.bondDenom) + unbondAmount, err := v14.InstantUnbonding(s.ctx, s.app.BankKeeper, s.app.StakingKeeper, delegation, s.bondDenom) s.Require().NoError(err, "failed to unbond") s.Require().Equal(unbondAmount, math.NewInt(1e18), "expected different unbond amount") diff --git a/precompiles/distribution/integration_test.go b/precompiles/distribution/integration_test.go index 1f90ce8760..fea8074e19 100644 --- a/precompiles/distribution/integration_test.go +++ b/precompiles/distribution/integration_test.go @@ -15,6 +15,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/vm" + cmn "github.com/evmos/evmos/v18/precompiles/common" "github.com/evmos/evmos/v18/precompiles/distribution" "github.com/evmos/evmos/v18/precompiles/testutil" @@ -204,7 +205,7 @@ var _ = Describe("Calling distribution precompile from EOA", func() { // create a validator with s.address and s.privKey because this account is // used for signing txs stakeAmt = math.NewInt(100) - testutil.CreateValidator(s.ctx, s.T(), s.privKey.PubKey(), *s.app.StakingKeeper.Keeper, stakeAmt) + testutil.CreateValidator(s.ctx, s.T(), s.privKey.PubKey(), s.app.StakingKeeper, stakeAmt) // set some validator commission valAddr = s.address.Bytes() @@ -793,7 +794,7 @@ var _ = Describe("Calling distribution precompile from another contract", func() // used for signing txs valAddr = s.address.Bytes() stakeAmt := math.NewInt(100) - testutil.CreateValidator(s.ctx, s.T(), s.privKey.PubKey(), *s.app.StakingKeeper.Keeper, stakeAmt) + testutil.CreateValidator(s.ctx, s.T(), s.privKey.PubKey(), s.app.StakingKeeper, stakeAmt) // set some commissions to validators var valAddresses []sdk.ValAddress diff --git a/precompiles/distribution/utils_test.go b/precompiles/distribution/utils_test.go index 4530cc4491..65afe6d70a 100644 --- a/precompiles/distribution/utils_test.go +++ b/precompiles/distribution/utils_test.go @@ -20,6 +20,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" + evmosapp "github.com/evmos/evmos/v18/app" cmn "github.com/evmos/evmos/v18/precompiles/common" "github.com/evmos/evmos/v18/precompiles/distribution" @@ -243,7 +244,7 @@ func (s *PrecompileTestSuite) prepareStakingRewards(stkRs ...stakingRewards) { s.Require().NoError(err) // end block to bond validator and increase block height - sdkstaking.EndBlocker(s.ctx, s.app.StakingKeeper.Keeper) + sdkstaking.EndBlocker(s.ctx, &s.app.StakingKeeper) // allocate rewards to validator (of these 50% will be paid out to the delegator) allocatedRewards := sdk.NewDecCoins(sdk.NewDecCoin(s.bondDenom, r.RewardAmt.Mul(math.NewInt(2)))) s.app.DistrKeeper.AllocateTokensToValidator(s.ctx, r.Validator, allocatedRewards) diff --git a/testutil/integration/evmos/network/clients.go b/testutil/integration/evmos/network/clients.go index 0772d842db..e9cc0bf40e 100644 --- a/testutil/integration/evmos/network/clients.go +++ b/testutil/integration/evmos/network/clients.go @@ -11,6 +11,7 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/evmos/evmos/v18/app" "github.com/evmos/evmos/v18/encoding" erc20types "github.com/evmos/evmos/v18/x/erc20/types" @@ -85,6 +86,6 @@ func (n *IntegrationNetwork) GetAuthzClient() authz.QueryClient { func (n *IntegrationNetwork) GetStakingClient() stakingtypes.QueryClient { queryHelper := getQueryHelper(n.GetContext()) - stakingtypes.RegisterQueryServer(queryHelper, stakingkeeper.Querier{Keeper: n.app.StakingKeeper.Keeper}) + stakingtypes.RegisterQueryServer(queryHelper, stakingkeeper.Querier{Keeper: &n.app.StakingKeeper}) return stakingtypes.NewQueryClient(queryHelper) } diff --git a/testutil/staking-rewards.go b/testutil/staking-rewards.go index 4fda9aa5a6..fb692bcfd3 100644 --- a/testutil/staking-rewards.go +++ b/testutil/staking-rewards.go @@ -17,10 +17,11 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" teststaking "github.com/cosmos/cosmos-sdk/x/staking/testutil" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/stretchr/testify/require" + "github.com/evmos/evmos/v18/app" testutiltx "github.com/evmos/evmos/v18/testutil/tx" "github.com/evmos/evmos/v18/utils" - "github.com/stretchr/testify/require" ) // CreateValidator creates a validator with the provided public key and stake amount @@ -110,7 +111,7 @@ func PrepareAccountsForDelegationRewards(t *testing.T, ctx sdk.Context, app *app err = app.StakingKeeper.SetParams(ctx, stakingParams) require.NoError(t, err) - stakingHelper := teststaking.NewHelper(t, ctx, app.StakingKeeper.Keeper) + stakingHelper := teststaking.NewHelper(t, ctx, &app.StakingKeeper) stakingHelper.Commission = stakingtypes.NewCommissionRates(zeroDec, zeroDec, zeroDec) stakingHelper.Denom = utils.BaseDenom @@ -122,7 +123,7 @@ func PrepareAccountsForDelegationRewards(t *testing.T, ctx sdk.Context, app *app // end block to bond validator and increase block height // Not using Commit() here because code panics due to invalid block height - staking.EndBlocker(ctx, app.StakingKeeper.Keeper) + staking.EndBlocker(ctx, &app.StakingKeeper) // allocate rewards to validator (of these 50% will be paid out to the delegator) validator := app.StakingKeeper.Validator(ctx, valAddr) diff --git a/x/erc20/keeper/utils_test.go b/x/erc20/keeper/utils_test.go index 2d7af39344..f61359356f 100644 --- a/x/erc20/keeper/utils_test.go +++ b/x/erc20/keeper/utils_test.go @@ -21,6 +21,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + "github.com/evmos/evmos/v18/app" "github.com/evmos/evmos/v18/contracts" "github.com/evmos/evmos/v18/crypto/ethsecp256k1" @@ -35,7 +37,6 @@ import ( evm "github.com/evmos/evmos/v18/x/evm/types" feemarkettypes "github.com/evmos/evmos/v18/x/feemarket/types" inflationtypes "github.com/evmos/evmos/v18/x/inflation/v1/types" - "github.com/stretchr/testify/require" ) func CreatePacket(amount, denom, sender, receiver, srcPort, srcChannel, dstPort, dstChannel string, seq, timeout uint64) channeltypes.Packet { @@ -103,7 +104,7 @@ func (suite *KeeperTestSuite) DoSetupTest(t require.TestingT) { valAddr := sdk.ValAddress(suite.address.Bytes()) validator, err := stakingtypes.NewValidator(valAddr, privCons.PubKey(), stakingtypes.Description{}) require.NoError(t, err) - validator = stakingkeeper.TestingUpdateValidator(suite.app.StakingKeeper.Keeper, suite.ctx, validator, true) + validator = stakingkeeper.TestingUpdateValidator(&suite.app.StakingKeeper, suite.ctx, validator, true) err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) require.NoError(t, err) err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) diff --git a/x/feemarket/keeper/utils_test.go b/x/feemarket/keeper/utils_test.go index be53167bd2..3d6caa6bed 100644 --- a/x/feemarket/keeper/utils_test.go +++ b/x/feemarket/keeper/utils_test.go @@ -70,7 +70,7 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool, chainID string) { valAddr := sdk.ValAddress(suite.address.Bytes()) validator, err := stakingtypes.NewValidator(valAddr, priv.PubKey(), stakingtypes.Description{}) require.NoError(t, err) - validator = stakingkeeper.TestingUpdateValidator(suite.app.StakingKeeper.Keeper, suite.ctx, validator, true) + validator = stakingkeeper.TestingUpdateValidator(&suite.app.StakingKeeper, suite.ctx, validator, true) err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) require.NoError(t, err) diff --git a/x/ibc/transfer/keeper/keeper_test.go b/x/ibc/transfer/keeper/keeper_test.go index e8b955866b..3d189c46a3 100644 --- a/x/ibc/transfer/keeper/keeper_test.go +++ b/x/ibc/transfer/keeper/keeper_test.go @@ -28,6 +28,7 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/evmos/evmos/v18/crypto/ethsecp256k1" "github.com/evmos/evmos/v18/server/config" "github.com/evmos/evmos/v18/testutil" @@ -122,7 +123,7 @@ func (suite *KeeperTestSuite) DoSetupTest(t require.TestingT) { valAddr := sdk.ValAddress(suite.address.Bytes()) validator, err := stakingtypes.NewValidator(valAddr, privCons.PubKey(), stakingtypes.Description{}) require.NoError(t, err) - validator = stakingkeeper.TestingUpdateValidator(suite.app.StakingKeeper.Keeper, suite.ctx, validator, true) + validator = stakingkeeper.TestingUpdateValidator(&suite.app.StakingKeeper, suite.ctx, validator, true) err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) require.NoError(t, err) err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) diff --git a/x/revenue/v1/keeper/utils_test.go b/x/revenue/v1/keeper/utils_test.go index 4dd9c81e03..e8633a4925 100644 --- a/x/revenue/v1/keeper/utils_test.go +++ b/x/revenue/v1/keeper/utils_test.go @@ -15,13 +15,14 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + "github.com/evmos/evmos/v18/crypto/ethsecp256k1" "github.com/evmos/evmos/v18/testutil" utiltx "github.com/evmos/evmos/v18/testutil/tx" "github.com/evmos/evmos/v18/utils" evmtypes "github.com/evmos/evmos/v18/x/evm/types" "github.com/evmos/evmos/v18/x/revenue/v1/types" - "github.com/stretchr/testify/require" ) func (suite *KeeperTestSuite) SetupApp(chainID string) { @@ -74,7 +75,7 @@ func (suite *KeeperTestSuite) SetupApp(chainID string) { valAddr := sdk.ValAddress(suite.address.Bytes()) validator, err := stakingtypes.NewValidator(valAddr, privCons.PubKey(), stakingtypes.Description{}) require.NoError(t, err) - validator = stakingkeeper.TestingUpdateValidator(suite.app.StakingKeeper.Keeper, suite.ctx, validator, true) + validator = stakingkeeper.TestingUpdateValidator(&suite.app.StakingKeeper, suite.ctx, validator, true) err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) require.NoError(t, err) err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) diff --git a/x/vesting/keeper/integration_test.go b/x/vesting/keeper/integration_test.go index 21261f640d..7d647e9a8b 100644 --- a/x/vesting/keeper/integration_test.go +++ b/x/vesting/keeper/integration_test.go @@ -25,6 +25,7 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common" + "github.com/evmos/evmos/v18/contracts" "github.com/evmos/evmos/v18/crypto/ethsecp256k1" "github.com/evmos/evmos/v18/testutil" @@ -249,7 +250,7 @@ var _ = Describe("Clawback Vesting Accounts", Ordered, func() { Expect(spendablePost).To(Equal(spendablePre.Sub(accountGasCoverage...))) // check delegation was created successfully - stkQuerier := stakingkeeper.Querier{Keeper: s.app.StakingKeeper.Keeper} + stkQuerier := stakingkeeper.Querier{Keeper: &s.app.StakingKeeper} delRes, err := stkQuerier.DelegatorDelegations(s.ctx, &stakingtypes.QueryDelegatorDelegationsRequest{DelegatorAddr: testAccount.clawbackAccount.Address}) Expect(err).To(BeNil()) Expect(delRes.DelegationResponses).To(HaveLen(1)) @@ -1275,7 +1276,7 @@ var _ = Describe("Clawback Vesting Accounts - claw back tokens", func() { // check delegation was not clawed back queryHelper := baseapp.NewQueryServerTestHelper(s.ctx, s.app.InterfaceRegistry()) - querier := stakingkeeper.Querier{Keeper: s.app.StakingKeeper.Keeper} + querier := stakingkeeper.Querier{Keeper: &s.app.StakingKeeper} stakingtypes.RegisterQueryServer(queryHelper, querier) qc := stakingtypes.NewQueryClient(queryHelper) delRes, err := qc.Delegation(s.ctx, &stakingtypes.QueryDelegationRequest{DelegatorAddr: vestingAddr.String(), ValidatorAddr: s.validator.OperatorAddress}) @@ -1334,7 +1335,7 @@ var _ = Describe("Clawback Vesting Accounts - claw back tokens", func() { Expect(balanceDest.Add(vesting[0]).Amount.Uint64()).To(Equal(bD.Amount.Uint64())) // check delegated tokens were not clawed back - stkQuerier := stakingkeeper.Querier{Keeper: s.app.StakingKeeper.Keeper} + stkQuerier := stakingkeeper.Querier{Keeper: &s.app.StakingKeeper} delRes, err := stkQuerier.DelegatorDelegations(s.ctx, &stakingtypes.QueryDelegatorDelegationsRequest{DelegatorAddr: vestingAddr.String()}) Expect(err).To(BeNil()) Expect(delRes.DelegationResponses).To(HaveLen(1)) @@ -1395,7 +1396,7 @@ var _ = Describe("Clawback Vesting Accounts - claw back tokens", func() { Expect(balanceDest).To(Equal(bD)) Expect(balanceCommPool.Amount).To(Equal(bCP.Amount)) // check delegated tokens were not clawed back - stkQuerier := stakingkeeper.Querier{Keeper: s.app.StakingKeeper.Keeper} + stkQuerier := stakingkeeper.Querier{Keeper: &s.app.StakingKeeper} delRes, err := stkQuerier.DelegatorDelegations(s.ctx, &stakingtypes.QueryDelegatorDelegationsRequest{DelegatorAddr: vestingAddr.String()}) Expect(err).To(BeNil()) Expect(delRes.DelegationResponses).To(HaveLen(1)) diff --git a/x/vesting/keeper/setup_test.go b/x/vesting/keeper/setup_test.go index b18a31fb43..3e4b83884d 100644 --- a/x/vesting/keeper/setup_test.go +++ b/x/vesting/keeper/setup_test.go @@ -146,7 +146,7 @@ func (suite *KeeperTestSuite) SetupTest() error { if err != nil { return err } - validator = stakingkeeper.TestingUpdateValidator(suite.app.StakingKeeper.Keeper, suite.ctx, validator, true) + validator = stakingkeeper.TestingUpdateValidator(&suite.app.StakingKeeper, suite.ctx, validator, true) err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) if err != nil { return err