This document provides a quick reference for the upgrades from v0.53.x to v0.54.x of Cosmos SDK.
Note, always read the App Wiring Changes section for more information on application wiring updates.
For a full list of changes, see the Changelog.
The x/gov module has been decoupled from x/staking. The keeper.NewKeeper constructor now requires a CalculateVoteResultsAndVotingPowerFn parameter instead of a StakingKeeper.
Before:
govKeeper := keeper.NewKeeper(
cdc,
storeService,
authKeeper,
bankKeeper,
stakingKeeper, // StakingKeeper parameter
distrKeeper,
router,
config,
authority,
)After:
govKeeper := keeper.NewKeeper(
cdc,
storeService,
authKeeper,
bankKeeper,
keeper.NewDefaultCalculateVoteResultsAndVotingPower(stakingKeeper), // Function parameter
distrKeeper,
router,
config,
authority,
)For applications using depinject, the governance module now accepts an optional CalculateVoteResultsAndVotingPowerFn. If not provided, it will use the StakingKeeper (also optional) to create the default function.
The AfterProposalSubmission hook now includes the proposer address as a parameter.
Before:
func (h MyGovHooks) AfterProposalSubmission(ctx context.Context, proposalID uint64) error {
// implementation
}After:
func (h MyGovHooks) AfterProposalSubmission(ctx context.Context, proposalID uint64, proposerAddr sdk.AccAddress) error {
// implementation
}