app

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// DefaultKeyPass contains the default key password for genesis transactions
	DefaultKeyPass = "12345678"
)

Variables

View Source
var (
	DefaultCLIHome  = os.ExpandEnv("$HOME/.panaceacli")
	DefaultNodeHome = os.ExpandEnv("$HOME/.panacead")
)

Functions

func CollectStdTxs

func CollectStdTxs(cdc *codec.Codec, moniker string, genTxsDir string, genDoc tmtypes.GenesisDoc) (
	appGenTxs []auth.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 MakeCodec

func MakeCodec() *codec.Codec

custom tx codec

func PanaceaAppGenStateJSON

func PanaceaAppGenStateJSON(cdc *codec.Codec, genDoc tmtypes.GenesisDoc, appGenTxs []json.RawMessage) (
	appState json.RawMessage, err error)

PanaceaAppGenState but with JSON

func PanaceaValidateGenesisState

func PanaceaValidateGenesisState(genesisState GenesisState) error

MediValidateGenesisState ensures that the genesis state obeys the expected invariants TODO: No validators are both bonded and jailed (#2088) TODO: Error if there is a duplicate validator (#1708) TODO: Ensure all state machine parameters are in genesis (#1704)

Types

type GenesisAccount

type GenesisAccount struct {
	Address       sdk.AccAddress `json:"address"`
	Coins         sdk.Coins      `json:"coins"`
	Sequence      uint64         `json:"sequence_number"`
	AccountNumber uint64         `json:"account_number"`

	// vesting account fields
	OriginalVesting  sdk.Coins `json:"original_vesting"`  // total vesting coins upon initialization
	DelegatedFree    sdk.Coins `json:"delegated_free"`    // delegated vested coins at time of delegation
	DelegatedVesting sdk.Coins `json:"delegated_vesting"` // delegated vesting coins at time of delegation
	StartTime        int64     `json:"start_time"`        // vesting start time (UNIX Epoch time)
	EndTime          int64     `json:"end_time"`          // vesting end time (UNIX Epoch time)
}

GenesisAccount defines an account initialized at genesis.

func NewDefaultGenesisAccount

func NewDefaultGenesisAccount(addr sdk.AccAddress) GenesisAccount

NewDefaultGenesisAccount returns default genesis account

func NewGenesisAccount

func NewGenesisAccount(acc *auth.BaseAccount) GenesisAccount

NewGenesisAccount returns new genesis account

func NewGenesisAccountI

func NewGenesisAccountI(acc auth.Account) GenesisAccount

NewGenesisAccountI no-lint

func (*GenesisAccount) ToAccount

func (ga *GenesisAccount) ToAccount() auth.Account

ToAccount converts GenesisAccount to auth.BaseAccount

type GenesisState

type GenesisState struct {
	Accounts     []GenesisAccount      `json:"accounts"`
	AuthData     auth.GenesisState     `json:"auth"`
	BankData     bank.GenesisState     `json:"bank"`
	StakingData  staking.GenesisState  `json:"staking"`
	MintData     mint.GenesisState     `json:"mint"`
	DistrData    distr.GenesisState    `json:"distr"`
	GovData      gov.GenesisState      `json:"gov"`
	CrisisData   crisis.GenesisState   `json:"crisis"`
	SlashingData slashing.GenesisState `json:"slashing"`
	AOLData      aol.GenesisState      `json:"aol"`
	GenTxs       []json.RawMessage     `json:"gentxs"`
}

State to Unmarshal

func NewDefaultGenesisState

func NewDefaultGenesisState() GenesisState

NewDefaultGenesisState generates the default state for panacea.

func NewGenesisState

func NewGenesisState(
	accounts []GenesisAccount,
	authData auth.GenesisState,
	bankData bank.GenesisState,
	stakingData staking.GenesisState,
	mintData mint.GenesisState,
	distrData distr.GenesisState,
	govData gov.GenesisState,
	crisisData crisis.GenesisState,
	slashingData slashing.GenesisState,
	aolData aol.GenesisState) GenesisState

NewGenesisState returns new genesis state

func PanaceaAppGenState

func PanaceaAppGenState(cdc *codec.Codec, genDoc tmtypes.GenesisDoc, appGenTxs []json.RawMessage) (
	genesisState GenesisState, err error)

PanaceaAppGenState creates the core parameters for genesis initialization for Panacea note that the pubkey input is this machines pubkey

func (GenesisState) Sanitize

func (gs GenesisState) Sanitize()

Sanitize sorts accounts and coin sets.

type PanaceaApp

type PanaceaApp struct {
	*bam.BaseApp
	// contains filtered or unexported fields
}

Extended ABCI application

func NewPanaceaApp

func NewPanaceaApp(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	invCheckPeriod uint,
	baseAppOptions ...func(*bam.BaseApp)) *PanaceaApp

NewPanaceaApp returns a reference to an initialized PanaceaApp.

func (*PanaceaApp) BeginBlocker

func (app *PanaceaApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

application updates every end block

func (*PanaceaApp) EndBlocker

func (app *PanaceaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

application updates every end block nolint: unparam

func (*PanaceaApp) ExportAppStateAndValidators

func (app *PanaceaApp) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string) (
	appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)

export the state of medi for a genesis file

func (*PanaceaApp) LoadHeight

func (app *PanaceaApp) LoadHeight(height int64) error

LoadHeight loads a particular height

type StakingHooks

type StakingHooks struct {
	// contains filtered or unexported fields
}

StakingHooks contains combined distribution and slashing hooks needed for the staking module.

func NewStakingHooks

func NewStakingHooks(dh distr.Hooks, sh slashing.Hooks) StakingHooks

NewStakingHooks nolint

func (StakingHooks) AfterDelegationModified

func (h StakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

AfterDelegationModified nolint

func (StakingHooks) AfterValidatorBeginUnbonding

func (h StakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

AfterValidatorBeginUnbonding nolint

func (StakingHooks) AfterValidatorBonded

func (h StakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

AfterValidatorBonded nolint

func (StakingHooks) AfterValidatorCreated

func (h StakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)

AfterValidatorCreated nolint

func (StakingHooks) AfterValidatorRemoved

func (h StakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)

AfterValidatorRemoved nolint

func (StakingHooks) BeforeDelegationCreated

func (h StakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

BeforeDelegationCreated nolint

func (StakingHooks) BeforeDelegationRemoved

func (h StakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

BeforeDelegationRemoved nolint

func (StakingHooks) BeforeDelegationSharesModified

func (h StakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)

BeforeDelegationSharesModified nolint

func (StakingHooks) BeforeValidatorModified

func (h StakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)

BeforeValidatorModified nolint

func (StakingHooks) BeforeValidatorSlashed

func (h StakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec)

BeforeValidatorSlashed nolint

Jump to

Keyboard shortcuts

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