Documentation ¶
Index ¶
- Constants
- Variables
- func GenesisStateFromGenDoc(cdc *codec.Codec, genDoc tmtypes.GenesisDoc) (genesisState map[string]json.RawMessage, err error)
- func GenesisStateFromGenFile(cdc *codec.Codec, genFile string) (genesisState map[string]json.RawMessage, genDoc *tmtypes.GenesisDoc, err error)
- func SetGenesisStateInAppState(cdc *codec.Codec, appState map[string]json.RawMessage, ...) map[string]json.RawMessage
- func ValidateGenesis(genesisState GenesisState, stakingFuncManager StakingFuncManager) error
- type AccountKeeper
- type AppMap
- type GenesisAccountsIterator
- type GenesisBalancesIterator
- type GenesisState
- type InitConfig
- type MigrationCallback
- type MigrationMap
- type StakingFuncManager
- type StakingKeeper
Constants ¶
const ModuleName = "genutil"
Variables ¶
var ModuleCdc *codec.Codec
ModuleCdc defines a generic sealed codec to be used throughout this module
Functions ¶
func GenesisStateFromGenDoc ¶
func GenesisStateFromGenDoc(cdc *codec.Codec, genDoc tmtypes.GenesisDoc, ) (genesisState map[string]json.RawMessage, err error)
GenesisStateFromGenDoc creates the core parameters for genesis initialization for the application.
NOTE: The pubkey input is this machines pubkey.
func GenesisStateFromGenFile ¶
func GenesisStateFromGenFile(cdc *codec.Codec, genFile string, ) (genesisState map[string]json.RawMessage, genDoc *tmtypes.GenesisDoc, err error)
GenesisStateFromGenFile creates the core parameters for genesis initialization for the application.
NOTE: The pubkey input is this machines pubkey.
func SetGenesisStateInAppState ¶
func SetGenesisStateInAppState(cdc *codec.Codec, appState map[string]json.RawMessage, genesisState GenesisState) map[string]json.RawMessage
SetGenesisStateInAppState sets the genutil genesis state within the expected app state
func ValidateGenesis ¶
func ValidateGenesis(genesisState GenesisState, stakingFuncManager StakingFuncManager) error
ValidateGenesis validates GenTx transactions
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { NewAccount(sdk.Context, accountexported.Account) accountexported.Account SetAccount(sdk.Context, accountexported.Account) IterateAccounts(ctx sdk.Context, process func(accountexported.Account) (stop bool)) }
AccountKeeper defines the expected account keeper (noalias)
type AppMap ¶
type AppMap map[string]json.RawMessage
AppMap map modules names with their json raw representation.
type GenesisAccountsIterator ¶
type GenesisAccountsIterator interface { IterateGenesisAccounts( cdc *codec.Codec, appGenesis types.AppGenesisState, cb func(accountexported.Account) (stop bool), ) }
GenesisAccountsIterator defines the expected iterating genesis accounts object (noalias)
type GenesisBalancesIterator ¶
type GenesisBalancesIterator interface { IterateGenesisBalances( cdc *codec.Codec, appStat types.AppGenesisState, cb func(asset.GenesisAsset) (stop bool), ) }
GenesisAccountsIterator defines the expected iterating genesis accounts object (noalias)
type GenesisState ¶
type GenesisState struct {
GenTxs []json.RawMessage `json:"gentxs" yaml:"gentxs"`
}
GenesisState defines the raw genesis transaction in JSON
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns the genutil module's default genesis state.
func GetGenesisStateFromAppState ¶
func GetGenesisStateFromAppState(cdc *codec.Codec, appState map[string]json.RawMessage) GenesisState
GetGenesisStateFromAppState gets the genutil genesis state from the expected app state
func NewGenesisState ¶
func NewGenesisState(genTxs []json.RawMessage) GenesisState
NewGenesisState creates a new GenesisState object
func NewGenesisStateFromStdTx ¶
func NewGenesisStateFromStdTx(genTxs []txutil.StdTx) GenesisState
NewGenesisStateFromStdTx creates a new GenesisState object from auth transactions
type InitConfig ¶
type InitConfig struct { ChainID string GenTxsDir string Name string NodeID string ValPubKey crypto.PubKey }
InitConfig common config options for init
func NewInitConfig ¶
func NewInitConfig(chainID, genTxsDir, name, nodeID string, valPubKey crypto.PubKey) InitConfig
NewInitConfig creates a new InitConfig object
type MigrationCallback ¶
MigrationCallback converts a genesis map from the previous version to the targeted one.
type MigrationMap ¶
type MigrationMap map[string]MigrationCallback
MigrationMap defines a mapping from a version to a MigrationCallback.
type StakingFuncManager ¶
type StakingFuncManager interface { // function: validate stakingtypes.MsgCreateValidator MsgCreateValidatorVal(msg sdk.Msg) bool // function: validate stakingtypes.MsgCreateValidator and check balance, then return monitor MsgDelegateWithBalance(m sdk.Msg, balancesMap map[string]asset.GenesisAsset) error GetMsgCreateValidatorMoniker(msg sdk.Msg) (string, error) // function: decode appGenesisState and get bondDenom GetBondDenom(appGenesisState map[string]json.RawMessage) string }
StakingFuncManager defines the expected staking functions
type StakingKeeper ¶
type StakingKeeper interface {
ApplyAndReturnValidatorSetUpdates(sdk.Context) (updates []abci.ValidatorUpdate)
}
StakingKeeper defines the expected staking keeper (noalias)