Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
likhita-809 committed Sep 20, 2023
1 parent 38fac38 commit 860fa77
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 25 deletions.
4 changes: 0 additions & 4 deletions types/module/configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ func (c *configurator) RegisterMigration(moduleName string, fromVersion uint64,
return nil
}

func (c *configurator) RegisterFundsMigration(toModuleName, fromModuleName string) error {
return nil
}

// runModuleMigrations runs all in-place store migrations for one given module from a
// version to another version.
func (c *configurator) runModuleMigrations(ctx sdk.Context, moduleName string, fromVersion, toVersion uint64) error {
Expand Down
2 changes: 2 additions & 0 deletions x/distribution/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ func (k Querier) DelegatorWithdrawAddress(ctx context.Context, req *types.QueryD
return &types.QueryDelegatorWithdrawAddressResponse{WithdrawAddress: withdrawAddr.String()}, nil
}

// NOTE: DO NOT USE
// This method uses deprecated query request. Use CommunityPool from x/pool module instead.
// CommunityPool queries the community pool coins
func (k Querier) CommunityPool(ctx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error) { //nolint:staticcheck // we're using a deprecated call for compatibility
helper := &baseapp.QueryServiceTestHelper{
Expand Down
28 changes: 9 additions & 19 deletions x/distribution/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"cosmossdk.io/math"
storetypes "cosmossdk.io/store/types"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
Expand Down Expand Up @@ -45,19 +44,16 @@ func TestSetWithdrawAddr(t *testing.T) {
bankKeeper.EXPECT().BlockedAddr(withdrawAddr).Return(false).AnyTimes()
bankKeeper.EXPECT().BlockedAddr(distrAcc.GetAddress()).Return(true).AnyTimes()

// Create MsgServiceRouter, but don't populate it before creating the gov
// keeper.
msr := baseapp.NewMsgServiceRouter()
qsr := baseapp.NewGRPCQueryRouter()
baseApp := initBaseApp(testCtx, encCfg)

distrKeeper := keeper.NewKeeper(
encCfg.Codec,
storeService,
accountKeeper,
bankKeeper,
stakingKeeper,
msr,
qsr,
baseApp.MsgServiceRouter(),
baseApp.GRPCQueryRouter(),
"fee_collector",
authtypes.NewModuleAddress("gov").String(),
)
Expand Down Expand Up @@ -103,19 +99,16 @@ func TestWithdrawValidatorCommission(t *testing.T) {
sdk.NewDecCoinFromDec("stake", math.LegacyNewDec(3).Quo(math.LegacyNewDec(2))),
}

// Create MsgServiceRouter, but don't populate it before creating the gov
// keeper.
msr := baseapp.NewMsgServiceRouter()
qsr := baseapp.NewGRPCQueryRouter()
baseApp := initBaseApp(testCtx, encCfg)

distrKeeper := keeper.NewKeeper(
encCfg.Codec,
storeService,
accountKeeper,
bankKeeper,
stakingKeeper,
msr,
qsr,
baseApp.MsgServiceRouter(),
baseApp.GRPCQueryRouter(),
"fee_collector",
authtypes.NewModuleAddress("gov").String(),
)
Expand Down Expand Up @@ -162,19 +155,16 @@ func TestGetTotalRewards(t *testing.T) {

accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress())

// Create MsgServiceRouter, but don't populate it before creating the gov
// keeper.
msr := baseapp.NewMsgServiceRouter()
qsr := baseapp.NewGRPCQueryRouter()
baseApp := initBaseApp(testCtx, encCfg)

distrKeeper := keeper.NewKeeper(
encCfg.Codec,
storeService,
accountKeeper,
bankKeeper,
stakingKeeper,
msr,
qsr,
baseApp.MsgServiceRouter(),
baseApp.GRPCQueryRouter(),
"fee_collector",
authtypes.NewModuleAddress("gov").String(),
)
Expand Down
4 changes: 2 additions & 2 deletions x/distribution/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (k msgServer) WithdrawValidatorCommission(ctx context.Context, msg *types.M
}

// NOTE: DO NOT USE
// This method uses deprecated messages. Use FundCommunityPool from x/pool module instead.
// This method uses deprecated message request. Use FundCommunityPool from x/pool module instead.
func (k msgServer) FundCommunityPool(ctx context.Context, msg *types.MsgFundCommunityPool) (*types.MsgFundCommunityPoolResponse, error) { //nolint:staticcheck // we're using a deprecated call for compatibility
sdkCtx := sdk.UnwrapSDKContext(ctx)

Expand Down Expand Up @@ -162,7 +162,7 @@ func (k msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams)
}

// NOTE: DO NOT USE
// This method uses deprecated messages. Use CommunityPoolSpend from x/pool module instead.
// This method uses deprecated message request. Use CommunityPoolSpend from x/pool module instead.
func (k msgServer) CommunityPoolSpend(ctx context.Context, msg *types.MsgCommunityPoolSpend) (*types.MsgCommunityPoolSpendResponse, error) { //nolint:staticcheck // we're using a deprecated call for compatibility
sdkCtx := sdk.UnwrapSDKContext(ctx)

Expand Down
1 change: 1 addition & 0 deletions x/upgrade/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ require (

replace cosmossdk.io/api => ../../api

// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409

replace (
Expand Down

0 comments on commit 860fa77

Please sign in to comment.