types

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeProposeSpan = "propose-span"

	AttributeKeySuccess        = "success"
	AttributeKeySpanID         = "span-id"
	AttributeKeySpanStartBlock = "start-block"
	AttributeKeySpanEndBlock   = "end-block"

	AttributeValueCategory = ModuleName
)

staking module event types

View Source
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
)
View Source
const (
	DefaultSprintDuration    uint64 = 64
	DefaultSpanDuration      uint64 = 100 * DefaultSprintDuration
	DefaultFirstSpanDuration uint64 = 256
	DefaultProducerCount     uint64 = 4
)

Default parameter values

View Source
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

View Source
const (
	// SlotCost cost for validator
	SlotCost int64 = 1
)

Variables

View Source
var (
	KeySprintDuration = []byte("SprintDuration")
	KeySpanDuration   = []byte("SpanDuration")
	KeyProducerCount  = []byte("ProducerCount")
)

Parameter keys

View Source
var ModuleCdc *codec.Codec

ModuleCdc generic sealed codec to be used throughout module

Functions

func ParamKeyTable

func ParamKeyTable() subspace.KeyTable

ParamKeyTable for auth module

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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

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

func (msg MsgProposeSpan) Type() string

Type returns message type

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 DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func NewParams

func NewParams(sprintDuration uint64, spanDuration uint64, producerCount uint64) Params

NewParams creates a new Params object

func (Params) Equal

func (p Params) Equal(p2 Params) bool

Equal returns a boolean determining if two Params types are identical.

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

func (Params) String

func (p Params) String() string

String implements the stringer interface.

func (Params) Validate

func (p Params) Validate() error

Validate checks that the parameters have valid values.

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.

Jump to

Keyboard shortcuts

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