Documentation
¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() subspace.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func SetGenesisStateToAppState(appState map[string]json.RawMessage, currentValSet hmTypes.ValidatorSet) (map[string]json.RawMessage, error)
- func ValidateGenesis(data GenesisState) error
- type GenesisState
- type IrisSpan
- type MsgProposeSpan
- type MsgProposeSpanV2
- func (msg MsgProposeSpanV2) GetSideSignBytes() []byte
- func (msg MsgProposeSpanV2) GetSignBytes() []byte
- func (msg MsgProposeSpanV2) GetSigners() []sdk.AccAddress
- func (msg MsgProposeSpanV2) Route() string
- func (msg MsgProposeSpanV2) Type() string
- func (msg MsgProposeSpanV2) ValidateBasic() sdk.Error
- type Params
- type QuerySpanParams
- type QuerySpanSeedResponse
- type ResponseWithHeight
- type Span
- type Validator
- type ValidatorSet
Constants ¶
const ( EventTypeProposeSpan = "propose-span" AttributeKeySuccess = "success" AttributeKeySpanID = "span-id" AttributeKeySpanStartBlock = "start-block" AttributeKeySpanEndBlock = "end-block" AttributeValueCategory = ModuleName )
staking module event types
const ( // ModuleName is the name of the module ModuleName = "zena" // StoreKey is the store key string for zena StoreKey = ModuleName // RouterKey is the message route for zena RouterKey = ModuleName // QuerierRoute is the querier route for zena QuerierRoute = ModuleName // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName )
const ( DefaultSprintDuration uint64 = 16 DefaultSpanDuration uint64 = 100 * DefaultSprintDuration DefaultFirstSpanDuration uint64 = 256 DefaultProducerCount uint64 = 4 )
Default parameter values
const ( QueryParams = "params" QuerySpan = "span" QuerySpanList = "span-list" QueryLatestSpan = "latest-span" QueryNextSpan = "next-span" QueryNextProducers = "next-producers" QueryNextSpanSeed = "next-span-seed" ParamSpan = "span" ParamSprint = "sprint" ParamProducerCount = "producer-count" ParamLastEthBlock = "last-eth-block" )
query endpoints supported by the auth Querier
const ( // SlotCost cost for validator SlotCost int64 = 1 )
Variables ¶
var ( KeySprintDuration = []byte("SprintDuration") KeySpanDuration = []byte("SpanDuration") KeyProducerCount = []byte("ProducerCount") )
Parameter keys
var ModuleCdc *codec.Codec
ModuleCdc generic sealed codec to be used throughout module
Functions ¶
func RegisterCodec ¶
func SetGenesisStateToAppState ¶
func SetGenesisStateToAppState(appState map[string]json.RawMessage, currentValSet hmTypes.ValidatorSet) (map[string]json.RawMessage, error)
SetGenesisStateToAppState sets state into app state
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis performs basic validation of zena genesis data returning an error for any failed validation criteria.
Types ¶
type GenesisState ¶
type GenesisState struct {
Params Params `json:"params" yaml:"params"`
Spans []*hmTypes.Span `json:"spans" yaml:"spans"` // list of spans
}
GenesisState is the zena state that must be provided at genesis.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default genesis state
func GetGenesisStateFromAppState ¶
func GetGenesisStateFromAppState(appState map[string]json.RawMessage) GenesisState
GetGenesisStateFromAppState returns staking GenesisState given raw application genesis state
func NewGenesisState ¶
func NewGenesisState(params Params, spans []*hmTypes.Span) GenesisState
NewGenesisState creates a new genesis state.
type IrisSpan ¶
type IrisSpan struct {
Span
ValidatorSet ValidatorSet `json:"validator_set" yaml:"validator_set"`
SelectedProducers []Validator `json:"selected_producers" yaml:"selected_producers"`
ChainID string `json:"zena_chain_id" yaml:"zena_chain_id"`
}
type MsgProposeSpan ¶
type MsgProposeSpan struct {
ID uint64 `json:"span_id"`
Proposer hmTypes.IrisAddress `json:"proposer"`
StartBlock uint64 `json:"start_block"`
EndBlock uint64 `json:"end_block"`
ChainID string `json:"zena_chain_id"`
Seed common.Hash `json:"seed"`
}
MsgProposeSpan creates msg propose span
func NewMsgProposeSpan ¶
func NewMsgProposeSpan( id uint64, proposer hmTypes.IrisAddress, startBlock uint64, endBlock uint64, chainID string, seed common.Hash, ) MsgProposeSpan
NewMsgProposeSpan creates new propose span message
func (MsgProposeSpan) GetSideSignBytes ¶
func (msg MsgProposeSpan) GetSideSignBytes() []byte
GetSideSignBytes returns side sign bytes
func (MsgProposeSpan) GetSignBytes ¶
func (msg MsgProposeSpan) GetSignBytes() []byte
GetSignBytes returns sign bytes for proposeSpan message type
func (MsgProposeSpan) GetSigners ¶
func (msg MsgProposeSpan) GetSigners() []sdk.AccAddress
GetSigners returns address of the signer
func (MsgProposeSpan) Route ¶
func (msg MsgProposeSpan) Route() string
Route returns route for message
func (MsgProposeSpan) ValidateBasic ¶
func (msg MsgProposeSpan) ValidateBasic() sdk.Error
ValidateBasic validates the message and returns error
type MsgProposeSpanV2 ¶
type MsgProposeSpanV2 struct {
ID uint64 `json:"span_id"`
Proposer hmTypes.IrisAddress `json:"proposer"`
StartBlock uint64 `json:"start_block"`
EndBlock uint64 `json:"end_block"`
ChainID string `json:"zena_chain_id"`
Seed common.Hash `json:"seed"`
SeedAuthor common.Address `json:"seed_author"`
}
MsgProposeSpanV2 creates msg propose span
func NewMsgProposeSpanV2 ¶
func NewMsgProposeSpanV2( id uint64, proposer hmTypes.IrisAddress, startBlock uint64, endBlock uint64, chainID string, seed common.Hash, seedAuthor common.Address, ) MsgProposeSpanV2
NewMsgProposeSpan creates new propose span message
func (MsgProposeSpanV2) GetSideSignBytes ¶
func (msg MsgProposeSpanV2) GetSideSignBytes() []byte
GetSideSignBytes returns side sign bytes
func (MsgProposeSpanV2) GetSignBytes ¶
func (msg MsgProposeSpanV2) GetSignBytes() []byte
GetSignBytes returns sign bytes for proposeSpan message type
func (MsgProposeSpanV2) GetSigners ¶
func (msg MsgProposeSpanV2) GetSigners() []sdk.AccAddress
GetSigners returns address of the signer
func (MsgProposeSpanV2) Route ¶
func (msg MsgProposeSpanV2) Route() string
Route returns route for message
func (MsgProposeSpanV2) ValidateBasic ¶
func (msg MsgProposeSpanV2) ValidateBasic() sdk.Error
ValidateBasic validates the message and returns error
type Params ¶
type Params struct {
SprintDuration uint64 `json:"sprint_duration" yaml:"sprint_duration"` // sprint duration
SpanDuration uint64 `json:"span_duration" yaml:"span_duration"` // span duration ie number of blocks for which val set is frozen on iris
ProducerCount uint64 `json:"producer_count" yaml:"producer_count"` // producer count per span
}
Params defines the parameters for the auth module.
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() subspace.ParamSetPairs
ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint
type QuerySpanParams ¶
type QuerySpanParams struct {
RecordID uint64
}
QuerySpanParams defines the params for querying accounts.
func NewQuerySpanParams ¶
func NewQuerySpanParams(recordID uint64) QuerySpanParams
NewQuerySpanParams creates a new instance of QuerySpanParams.
type QuerySpanSeedResponse ¶
type QuerySpanSeedResponse struct {
Seed common.Hash `json:"seed"`
SeedAuthor common.Address `json:"seed_author"`
}
QuerySpanSeedResponse defines the response to a span seed query
func NewQuerySpanSeedResponse ¶
func NewQuerySpanSeedResponse(seed common.Hash, seedAuthor common.Address) QuerySpanSeedResponse
NewQuerySpanSeedResponse creates a new instance of QuerySpanSeedResponse.
type ResponseWithHeight ¶
type ResponseWithHeight struct {
Height string `json:"height"`
Result json.RawMessage `json:"result"`
}
ResponseWithHeight defines a response object type that wraps an original response with a height.
type Span ¶
type Span struct {
ID uint64 `json:"span_id" yaml:"span_id"`
StartBlock uint64 `json:"start_block" yaml:"start_block"`
EndBlock uint64 `json:"end_block" yaml:"end_block"`
}
Span Zena represents a current zena span
type Validator ¶
type Validator struct {
ID uint64 `json:"ID"`
Address common.Address `json:"signer"`
VotingPower int64 `json:"power"`
ProposerPriority int64 `json:"accum"`
}
Validator represents Volatile state for each Validator
type ValidatorSet ¶
type ValidatorSet struct {
// NOTE: persisted via reflect, must be exported.
Validators []*Validator `json:"validators"`
Proposer *Validator `json:"proposer"`
// contains filtered or unexported fields
}
IrisSpan represents span from iris APIs