consensus

package
v0.23.0-rc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateValue

func MigrateValue(store sdk.KVStore, cdc codec.BinaryCodec, prefixBz []byte, migrator ValueMigrator) (err error)

MigrateValue is a helper function that migrates values stored in a KV store for the given key prefix using the given value migrator function.

func ModuleMigrations

func ModuleMigrations(module string, migrator Migrator, fn func(string, uint64, sdkmodule.MigrationHandler))

func ModuleVersion

func ModuleVersion(module string) uint64

func RegisterMigration

func RegisterMigration(module string, version uint64, initFn NewMigrationFn)

Types

type Migration

type Migration interface {
	GetHandler() sdkmodule.MigrationHandler
}

type Migrator

type Migrator interface {
	StoreKey() sdk.StoreKey
	Codec() codec.BinaryCodec
}

type NewMigrationFn

type NewMigrationFn func(Migrator) Migration

type ValueMigrator

type ValueMigrator func(oldValueBz []byte, cdc codec.BinaryCodec) codec.ProtoMarshaler

ValueMigrator migrates a value to the new protobuf type given its old protobuf serialized bytes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL