poa

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: GPL-3.0 Imports: 16 Imported by: 2

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

View Source
const (
	ModuleName        = types.ModuleName
	StoreKey          = types.ModuleName
	DefaultCodespace  = types.DefaultCodespace
	DefaultParamspace = types.DefaultParamspace
	QuerierRoute      = types.ModuleName
)
View Source
const (
	QueryGetValidators = "validators"
	QueryGetMinMax     = "minmax"
	QueryGetValidator  = "validator"
)

Supported queries.

Variables

View Source
var ModuleCdc *codec.Codec

Functions

func NewAppMsModule

func NewAppMsModule(poaKeeper Keeper) core.AppMsModule

Create new PoA module.

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

New message handler for PoA module.

func NewKeyTable

func NewKeyTable() params.KeyTable

New Paramstore for PoA module.

func NewMsHandler

func NewMsHandler(keeper Keeper) core.MsHandler

New multisignature message handler for PoA module.

func NewQuerier

func NewQuerier(poaKeeper Keeper) sdk.Querier

Creating new Querier.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Registering amino types for PoA messages

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

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) Name

func (AppModule) Name() string

Get name of module.

func (AppModule) NewHandler

func (app AppModule) NewHandler() sdk.Handler

Create new handler.

func (AppModule) NewMsHandler

func (app AppModule) NewMsHandler() core.MsHandler

Create new multisignature handler.

func (AppModule) NewQuerierHandler

func (app AppModule) NewQuerierHandler() sdk.Querier

Get new querier for PoA module.

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

Get route for querier.

func (AppModule) RegisterInvariants

func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

Register module invariants.

func (AppModule) Route

func (AppModule) Route() string

Base route of module (for handler).

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) Name

func (AppModuleBasic) Name() string

Module name.

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 NewKeeper

func NewKeeper(storeKey sdk.StoreKey, cdc *codec.Codec, paramStore params.Subspace) Keeper

Creating new keeper with parameters store.

func (Keeper) AddValidator

func (poaKeeper Keeper) AddValidator(ctx sdk.Context, address sdk.AccAddress, ethAddress string)

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

func (poaKeeper Keeper) GetEnoughConfirmations(ctx sdk.Context) uint16

Get amount of confirmations to do action.

func (Keeper) GetMaxValidators

func (poaKeeper Keeper) GetMaxValidators(ctx sdk.Context) (res uint16)

Get max validators amount.

func (Keeper) GetMinValidators

func (poaKeeper Keeper) GetMinValidators(ctx sdk.Context) (res uint16)

Get minimum validators amount.

func (Keeper) GetParams

func (poaKeeper Keeper) GetParams(ctx sdk.Context) types.Params

Get params.

func (Keeper) GetValidator

func (poaKeeper Keeper) GetValidator(ctx sdk.Context, address sdk.AccAddress) types.Validator

Getting validator from storage.

func (Keeper) GetValidatorAmount

func (poaKeeper Keeper) GetValidatorAmount(ctx sdk.Context) uint16

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

func (poaKeeper Keeper) HasValidator(ctx sdk.Context, address sdk.AccAddress) bool

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.

func (Keeper) SetParams

func (poaKeeper Keeper) SetParams(ctx sdk.Context, params types.Params)

Set the params.

Directories

Path Synopsis
cli
Initialize commands for cli (add genesis validator).
Initialize commands for cli (add genesis validator).
Message to add validator described.
Message to add validator described.
Described types for PoA module.
Described types for PoA module.

Jump to

Keyboard shortcuts

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