types

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPreVoteStreamingSession

func NewPreVoteStreamingSession(chainId string) (PreVoteStreamingSessionId, PreVoteStreamingSessionKey, error)

NewPreVoteStreamingSession generates a new session id and key pair with seed is given chain-id

Types

type PreVoteStreamingSessionId

type PreVoteStreamingSessionId string

func (PreVoteStreamingSessionId) ForChainId

func (sid PreVoteStreamingSessionId) ForChainId(chainId string) bool

ForChainId returns true if the session id value is for the given chain id.

func (PreVoteStreamingSessionId) ValidateBasic

func (sid PreVoteStreamingSessionId) ValidateBasic() error

ValidateBasic returns an error if the session id is invalid format.

type PreVoteStreamingSessionKey

type PreVoteStreamingSessionKey string

func (PreVoteStreamingSessionKey) ValidateBasic

func (sk PreVoteStreamingSessionKey) ValidateBasic() error

ValidateBasic returns an error if the session key is invalid format.

type PreVoteStreamingSessionRegistrationResponse

type PreVoteStreamingSessionRegistrationResponse struct {
	SessionId  PreVoteStreamingSessionId  `json:"session-id"`
	SessionKey PreVoteStreamingSessionKey `json:"session-key"`
}

type StreamingLightValidator

type StreamingLightValidator struct {
	Index                     int     `json:"i"`
	VotingPowerDisplayPercent float64 `json:"vdp"`
	Moniker                   string  `json:"m"`
}

type StreamingLightValidators

type StreamingLightValidators []StreamingLightValidator

type StreamingNextBlockVotingInformation

type StreamingNextBlockVotingInformation struct {
	HeightRoundStep       string                        `json:"hrs"`
	Duration              time.Duration                 `json:"d,omitempty"`
	PreVotedPercent       float64                       `json:"pv,omitempty"`
	PreCommitVotedPercent float64                       `json:"pc,omitempty"`
	ValidatorVoteStates   []StreamingValidatorVoteState `json:"v,omitempty"`
}

type StreamingValidatorVoteState

type StreamingValidatorVoteState struct {
	ValidatorIndex    int    `json:"i"`
	PreVotedBlockHash string `json:"hash,omitempty"`
	PreVoted          bool   `json:"pv,omitempty"`
	VotedZeroes       bool   `json:"vz,omitempty"`
	PreCommitVoted    bool   `json:"pc,omitempty"`
}

Jump to

Keyboard shortcuts

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