Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 1.66 KB

File metadata and controls

65 lines (51 loc) · 1.66 KB

Upgrade Reference

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.

TLDR

For a full list of changes, see the Changelog.

x/gov

Keeper Initialization

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.

GovHooks Interface

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
}