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 HeimdallSpan
- type MsgProposeSpan
- type Params
- type QuerySpanParams
- 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 = "bor" // StoreKey is the store key string for bor StoreKey = ModuleName // RouterKey is the message route for bor RouterKey = ModuleName // QuerierRoute is the querier route for bor QuerierRoute = ModuleName // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName )
const ( DefaultSprintDuration uint64 = 64 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 bor 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 bor 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 HeimdallSpan ¶ added in v0.3.3
type HeimdallSpan struct { Span ValidatorSet ValidatorSet `json:"validator_set" yaml:"validator_set"` SelectedProducers []Validator `json:"selected_producers" yaml:"selected_producers"` ChainID string `json:"bor_chain_id" yaml:"bor_chain_id"` }
type MsgProposeSpan ¶
type MsgProposeSpan struct { ID uint64 `json:"span_id"` Proposer hmTypes.HeimdallAddress `json:"proposer"` StartBlock uint64 `json:"start_block"` EndBlock uint64 `json:"end_block"` ChainID string `json:"bor_chain_id"` Seed common.Hash `json:"seed"` }
MsgProposeSpan creates msg propose span
func NewMsgProposeSpan ¶
func NewMsgProposeSpan( id uint64, proposer hmTypes.HeimdallAddress, startBlock uint64, endBlock uint64, chainID string, seed common.Hash, ) MsgProposeSpan
NewMsgProposeSpan creates new propose span message
func (MsgProposeSpan) GetSideSignBytes ¶ added in v0.1.7
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 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 heimdall 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 ResponseWithHeight ¶ added in v0.3.3
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 ¶ added in v0.3.3
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 Bor represents a current bor span
type Validator ¶ added in v0.3.3
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 ¶ added in v0.3.3
type ValidatorSet struct { // NOTE: persisted via reflect, must be exported. Validators []*Validator `json:"validators"` Proposer *Validator `json:"proposer"` // contains filtered or unexported fields }
HeimdallSpan represents span from heimdall APIs