Skip to content

Commit

Permalink
chg: register interfaces in gov test app
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Mar 8, 2024
1 parent 39fd8a9 commit 0223595
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
13 changes: 8 additions & 5 deletions x/gov/keeper/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package keeper_test

import (
"fmt"
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"testing"

cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
Expand Down Expand Up @@ -72,6 +74,9 @@ func setupGovKeeper(t *testing.T) (
v1.RegisterInterfaces(encCfg.InterfaceRegistry)
v1beta1.RegisterInterfaces(encCfg.InterfaceRegistry)
banktypes.RegisterInterfaces(encCfg.InterfaceRegistry)
stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
authtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
consensustypes.RegisterInterfaces(encCfg.InterfaceRegistry)

// Create MsgServiceRouter, but don't populate it before creating the gov
// keeper.
Expand All @@ -95,11 +100,9 @@ func setupGovKeeper(t *testing.T) (
}).AnyTimes()

stakingKeeper.EXPECT().BondDenom(ctx).Return("matic", nil).AnyTimes()
/* HV2: not invoked in heimdall
stakingKeeper.EXPECT().IterateBondedValidatorsByPower(gomock.Any(), gomock.Any()).AnyTimes()
stakingKeeper.EXPECT().IterateDelegations(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()).Return(math.NewInt(10000000), nil).AnyTimes()
*/
stakingKeeper.EXPECT().IterateCurrentValidatorsAndApplyFn(gomock.Any(), gomock.Any()).AnyTimes()
stakingKeeper.EXPECT().TokensFromConsensusPower(gomock.Any(), gomock.Any()).AnyTimes()
stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewHexCodec()).AnyTimes()
distributionKeeper.EXPECT().FundCommunityPool(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()

// Gov keeper initializations
Expand Down
3 changes: 2 additions & 1 deletion x/gov/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() {
expErr: true,
expErrMsg: "summary too long",
},
// HV2 *testdata.TestMsg is not a valid proposal message type
// HV2: testdata.TestMsg is not a valid proposal message type
"invalid proposal message type": {
preRun: func() (*v1.MsgSubmitProposal, error) {
return v1.NewMsgSubmitProposal(
Expand Down Expand Up @@ -214,6 +214,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() {
expErr: true,
expErrMsg: "invalid proposal message type",
},
// HV2: banktypes.NewMsgSend is not a valid proposal message type
"msg send not supported": {
preRun: func() (*v1.MsgSubmitProposal, error) {
return v1.NewMsgSubmitProposal(
Expand Down

0 comments on commit 0223595

Please sign in to comment.