Documentation ¶
Overview ¶
Aliases to use them outside pocket without import of specific package.
Functions to work with genesis data of module.
PoA keeper main functional.
Implements PoA module.
Multisignature handler for processing multisignature messages like: add, remove, replace validator.
Parameters key table implementation for PoA parameters store.
Querier for PoA module.
Index ¶
- Constants
- Variables
- func NewAppMsModule(poaKeeper Keeper) core.AppMsModule
- func NewHandler(keeper Keeper) sdk.Handler
- func NewKeyTable() params.KeyTable
- func NewMsHandler(keeper Keeper) core.MsHandler
- func NewQuerier(poaKeeper Keeper) sdk.Querier
- func RegisterCodec(cdc *codec.Codec)
- type AppModule
- func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (app AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (app AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (app AppModule) NewHandler() sdk.Handler
- func (app AppModule) NewMsHandler() core.MsHandler
- func (app AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
- func (module AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (module AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, r *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type Keeper
- func (poaKeeper Keeper) AddValidator(ctx sdk.Context, address sdk.AccAddress, ethAddress string)
- func (poaKeeper Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState
- func (poaKeeper Keeper) GetEnoughConfirmations(ctx sdk.Context) uint16
- func (poaKeeper Keeper) GetMaxValidators(ctx sdk.Context) (res uint16)
- func (poaKeeper Keeper) GetMinValidators(ctx sdk.Context) (res uint16)
- func (poaKeeper Keeper) GetParams(ctx sdk.Context) types.Params
- func (poaKeeper Keeper) GetValidator(ctx sdk.Context, address sdk.AccAddress) types.Validator
- func (poaKeeper Keeper) GetValidatorAmount(ctx sdk.Context) uint16
- func (poaKeeper Keeper) GetValidators(ctx sdk.Context) types.Validators
- func (poaKeeper Keeper) HasValidator(ctx sdk.Context, address sdk.AccAddress) bool
- func (poaKeeper Keeper) InitGenesis(ctx sdk.Context, genesisState types.GenesisState)
- func (poaKeeper Keeper) RemoveValidator(ctx sdk.Context, address sdk.AccAddress)
- func (poaKeeper Keeper) ReplaceValidator(ctx sdk.Context, oldAddress sdk.AccAddress, newAddress sdk.AccAddress, ...)
- func (poaKeeper Keeper) SetParams(ctx sdk.Context, params types.Params)
Constants ¶
const ( ModuleName = types.ModuleName StoreKey = types.ModuleName DefaultCodespace = types.DefaultCodespace DefaultParamspace = types.DefaultParamspace QuerierRoute = types.ModuleName )
const ( QueryGetValidators = "validators" QueryGetMinMax = "minmax" QueryGetValidator = "validator" )
Supported queries.
Variables ¶
var ModuleCdc *codec.Codec
Functions ¶
func NewMsHandler ¶
New multisignature message handler for PoA module.
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
PoA module.
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
Process begin block (abci).
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
Process end block (abci).
func (AppModule) ExportGenesis ¶
func (app AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
Export genesis.
func (AppModule) InitGenesis ¶
func (app AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
Initialize genesis.
func (AppModule) NewMsHandler ¶
Create new multisignature handler.
func (AppModule) NewQuerierHandler ¶
Get new querier for PoA module.
func (AppModule) RegisterInvariants ¶
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
Register module invariants.
type AppModuleBasic ¶
type AppModuleBasic struct{}
func (AppModuleBasic) DefaultGenesis ¶
func (module AppModuleBasic) DefaultGenesis() json.RawMessage
Generate default genesis.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
Get query commands for CLI.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
Get transaction commands for CLI.
func (AppModuleBasic) RegisterCodec ¶
func (module AppModuleBasic) RegisterCodec(cdc *codec.Codec)
Registering codecs.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, r *mux.Router)
Register REST routes.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
Validate exists genesis.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
PoA keeper implementation.
func (Keeper) AddValidator ¶
Add new validator to list of PoA validators.
func (Keeper) ExportGenesis ¶
func (poaKeeper Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState
Export genesis data for this module.
func (Keeper) GetEnoughConfirmations ¶
Get amount of confirmations to do action.
func (Keeper) GetMaxValidators ¶
Get max validators amount.
func (Keeper) GetMinValidators ¶
Get minimum validators amount.
func (Keeper) GetValidator ¶
Getting validator from storage.
func (Keeper) GetValidatorAmount ¶
Get total amount of validators.
func (Keeper) GetValidators ¶
func (poaKeeper Keeper) GetValidators(ctx sdk.Context) types.Validators
Get validators from validators list.
func (Keeper) HasValidator ¶
Check if validator exists in list or not.
func (Keeper) InitGenesis ¶
func (poaKeeper Keeper) InitGenesis(ctx sdk.Context, genesisState types.GenesisState)
Initialize genesis for this module.
func (Keeper) RemoveValidator ¶
func (poaKeeper Keeper) RemoveValidator(ctx sdk.Context, address sdk.AccAddress)
Remove validator that exists in validators list.
func (Keeper) ReplaceValidator ¶
func (poaKeeper Keeper) ReplaceValidator(ctx sdk.Context, oldAddress sdk.AccAddress, newAddress sdk.AccAddress, ethAddress string)
Replace validator with another one.