Documentation
¶
Index ¶
- Constants
- func ConvertToLegacyDeposit(deposit *v1.Deposit) v1beta1.Deposit
- func ConvertToLegacyProposal(proposal v1.Proposal) (v1beta1.Proposal, error)
- func ConvertToLegacyTallyResult(tally *v1.TallyResult) (v1beta1.TallyResult, error)
- func ConvertToLegacyVote(vote v1.Vote) (v1beta1.Vote, error)
- func ConvertToLegacyVoteOptions(voteOptions []*v1.WeightedVoteOption) ([]v1beta1.WeightedVoteOption, error)
- func MigrateJSON(oldState *v1beta1.GenesisState) (*v1.GenesisState, error)
- func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error
- func Migrate_V046_6_To_V046_7(store sdk.KVStore, cdc codec.BinaryCodec) error
Constants ¶
const (
// ModuleName is the name of the module
ModuleName = "gov"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertToLegacyProposal ¶
ConvertToLegacyProposal takes a new proposal and attempts to convert it to the legacy proposal format. This conversion is best effort. New proposal types that don't have a legacy message will return a "nil" content.
func ConvertToLegacyTallyResult ¶
func ConvertToLegacyTallyResult(tally *v1.TallyResult) (v1beta1.TallyResult, error)
func ConvertToLegacyVoteOptions ¶
func ConvertToLegacyVoteOptions(voteOptions []*v1.WeightedVoteOption) ([]v1beta1.WeightedVoteOption, error)
func MigrateJSON ¶
func MigrateJSON(oldState *v1beta1.GenesisState) (*v1.GenesisState, error)
MigrateJSON accepts exported v0.43 x/gov genesis state and migrates it to v0.46 x/gov genesis state. The migration includes:
- Updating everything to v1. - Migrating proposals to be Msg-based.
func MigrateStore ¶
func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error
MigrateStore performs in-place store migrations from v2 (v0.43) to v3 (v0.46). The migration includes:
- Migrate proposals to be Msg-based.
func Migrate_V046_6_To_V046_7 ¶ added in v0.46.7
func Migrate_V046_6_To_V046_7(store sdk.KVStore, cdc codec.BinaryCodec) error
Migrate_V046_4_To_V046_5 is a helper function to migrate chains from <=v0.46.6 to v0.46.7 ONLY.
IMPORTANT: Please do not use this function if you are upgrading to v0.46 from <=v0.45.
This function migrates the store in-place by fixing the gov votes weight to be stored as decimals strings (instead of the sdk.Dec BigInt representation).
The store is expected to be the gov store, and not any prefixed substore.
Types ¶
This section is empty.