Skip to content

Commit

Permalink
fix build 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobhjkim committed Jul 16, 2024
1 parent d6b4010 commit 3eab303
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 34 deletions.
18 changes: 9 additions & 9 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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)),
)
Expand Down Expand Up @@ -1197,7 +1197,7 @@ func (app *Evmos) setupUpgradeHandlers() {
v10.UpgradeName,
v10.CreateUpgradeHandler(
app.mm, app.configurator,
*app.StakingKeeper.Keeper,
app.StakingKeeper,
),
)

Expand All @@ -1208,7 +1208,7 @@ func (app *Evmos) setupUpgradeHandlers() {
app.mm, app.configurator,
app.AccountKeeper,
app.BankKeeper,
*app.StakingKeeper.Keeper,
app.StakingKeeper,
app.DistrKeeper,
),
)
Expand Down Expand Up @@ -1254,7 +1254,7 @@ func (app *Evmos) setupUpgradeHandlers() {
app.mm, app.configurator,
app.BankKeeper,
app.EvmKeeper,
*app.StakingKeeper.Keeper,
app.StakingKeeper,
),
)

Expand Down
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 5 additions & 3 deletions app/upgrades/v11/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ 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"
tmversion "github.com/cometbft/cometbft/proto/tendermint/version"
"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"
)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions app/upgrades/v14/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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")

Expand Down
5 changes: 3 additions & 2 deletions precompiles/distribution/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion precompiles/distribution/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion testutil/integration/evmos/network/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
7 changes: 4 additions & 3 deletions testutil/staking-rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions x/erc20/keeper/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion x/feemarket/keeper/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion x/ibc/transfer/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions x/revenue/v1/keeper/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions x/vesting/keeper/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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})
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion x/vesting/keeper/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3eab303

Please sign in to comment.