genutil

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = types.ModuleName
)

const

Variables

View Source
var (
	// nolint
	ModuleCdc                    = types.ModuleCdc
	GenesisStateFromGenFile      = sdkgenutil.GenesisStateFromGenFile
	NewGenesisState              = sdkgenutil.NewGenesisState
	SetGenesisStateInAppState    = sdkgenutil.SetGenesisStateInAppState
	InitializeNodeValidatorFiles = sdkgenutil.InitializeNodeValidatorFiles
	ExportGenesisFileWithTime    = sdkgenutil.ExportGenesisFileWithTime
	NewInitConfig                = sdkgenutil.NewInitConfig
	ValidateGenesis              = types.ValidateGenesis
	GenesisStateFromGenDoc       = sdkgenutil.GenesisStateFromGenDoc
	SetGenTxsInAppGenesisState   = sdkgenutil.SetGenTxsInAppGenesisState
	ExportGenesisFile            = sdkgenutil.ExportGenesisFile
)

Functions

func CollectStdTxs

func CollectStdTxs(cdc *codec.Codec, moniker, genTxsDir string,
	genDoc tmtypes.GenesisDoc, genAccIterator types.GenesisAccountsIterator,
) (appGenTxs []authtypes.StdTx, persistentPeers string, err error)

CollectStdTxs processes and validates application's genesis StdTxs and returns the list of appGenTxs, and persistent peers required to generate genesis.json.

func DeliverGenTxs

func DeliverGenTxs(ctx sdk.Context, cdc *codec.Codec, genTxs []json.RawMessage,
	stakingKeeper types.StakingKeeper, deliverTx deliverTxfn) []abci.ValidatorUpdate

DeliverGenTxs - deliver a genesis transaction

func GenAppStateFromConfig

func GenAppStateFromConfig(cdc *codec.Codec, config *cfg.Config,
	initCfg InitConfig, genDoc tmtypes.GenesisDoc,
	genAccIterator types.GenesisAccountsIterator,
) (appState json.RawMessage, err error)

GenAppStateFromConfig gets the genesis app state from the config

func InitGenesis

func InitGenesis(ctx sdk.Context, cdc *codec.Codec, stakingKeeper types.StakingKeeper,
	deliverTx deliverTxfn, genesisState GenesisState) []abci.ValidatorUpdate

InitGenesis - initialize accounts and deliver genesis transactions

func NewAppModule

func NewAppModule(accountKeeper types.AccountKeeper,
	stakingKeeper types.StakingKeeper, deliverTx deliverTxfn) module.AppModule

NewAppModule creates a new AppModule object

func ValidateAccountInGenesis

func ValidateAccountInGenesis(appGenesisState map[string]json.RawMessage,
	genAccIterator types.GenesisAccountsIterator,
	key sdk.AccAddress, coins sdk.Coins, cdc *codec.Codec) error

ValidateAccountInGenesis checks that the provided key has sufficient coins in the genesis accounts

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule is the struct of this app module

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

ExportGenesis exports the module genesis state

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

InitGenesis initializes the module genesis state

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic is the struct of app module basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

DefaultGenesis returns the default genesis state in json raw message

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(_ *codec.Codec) *cobra.Command

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the module name

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

nolint

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(_ context.CLIContext, _ *mux.Router)

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

ValidateGenesis gives a quick validity check for module genesis

type GenesisAccountsIterator

type GenesisAccountsIterator = sdkgenutiltypes.GenesisAccountsIterator

GenesisAccountsIterator is the type alias of the one in cmsdk

type GenesisState

type GenesisState = types.GenesisState

GenesisState is the type alias of the one in cmsdk

type InitConfig

type InitConfig = sdkgenutil.InitConfig

InitConfig is the type alias of the one in cmsdk

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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