types

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseAbciQueryResponse

type BaseAbciQueryResponse struct {
	Result *coretypes.ResultABCIQuery `json:"result"`
}

func (*BaseAbciQueryResponse) GetBuffer

func (re *BaseAbciQueryResponse) GetBuffer() ([]byte, error)

func (*BaseAbciQueryResponse) GetError

func (re *BaseAbciQueryResponse) GetError() error

type BaseAbciQueryResponseResultResponse

type BaseAbciQueryResponseResultResponse struct {
	Code  int    `json:"code"`
	Log   string `json:"log"`
	Value string `json:"value"`
	Index string `json:"index"`
}

type BaseRpcResponse

type BaseRpcResponse[T any] struct {
	Error  *BaseRpcResponseError `json:"error"`
	Result *T                    `json:"result"`
}

type BaseRpcResponseError

type BaseRpcResponseError struct {
	Message string `json:"message"`
	Data    string `json:"data"`
}

func (*BaseRpcResponseError) GetError

func (re *BaseRpcResponseError) GetError() error

type LightValidator

type LightValidator struct {
	Index                     int // index in the validator set returned by RPC '/validators'
	Moniker                   string
	Address                   string
	PubKey                    string
	VotingPower               int64
	VotingPowerDisplayPercent float64 // the value is rounded so only use for display purpose
}

LightValidator is a light version of Validator, it contains minimal information needed for application business logic.

func (LightValidator) GetFingerPrintAddress

func (lv LightValidator) GetFingerPrintAddress() string

GetFingerPrintAddress returns the first 6 bytes of the address. Tendermint/CometBFT is using this to identify the validator in pre-(commit)-votes.

type LightValidators

type LightValidators []LightValidator

LightValidators is a list of LightValidator.

CONTRACT: must maintain the same order as the result from the RPC server.

func (LightValidators) GetLightValidatorByIndex

func (lvs LightValidators) GetLightValidatorByIndex(index int) LightValidator

func (LightValidators) TotalVotingPower

func (lvs LightValidators) TotalVotingPower() uint64

type NextBlockVotingInformation

type NextBlockVotingInformation struct {
	SortedValidatorVoteStates []ValidatorVoteState
	PreVotePercent            float64
	PreCommitPercent          float64
	HeightRoundStep           string
	StartTimeUTC              time.Time
}

type RoundState

type RoundState struct {
	HeightRoundStep string       `json:"height/round/step"`
	StartTime       time.Time    `json:"start_time"`
	Votes           []RoundVotes `json:"height_vote_set"`
}

func (RoundState) GetPreCommitPercent

func (rs RoundState) GetPreCommitPercent(round int) (percent float64, err error)

func (RoundState) GetPreVotePercent

func (rs RoundState) GetPreVotePercent(round int) (percent float64, err error)

func (RoundState) GetRound

func (rs RoundState) GetRound() (round int, err error)

type RoundStateResponse

type RoundStateResponse struct {
	RoundState *RoundState `json:"round_state"`
}

type RoundVotes

type RoundVotes struct {
	PreVotes           []string `json:"prevotes"`
	PreVotesBitArray   string   `json:"prevotes_bit_array"`
	PreCommits         []string `json:"precommits"`
	PreCommitsBitArray string   `json:"precommits_bit_array"`
}

type ValidatorVoteState

type ValidatorVoteState struct {
	Validator       LightValidator
	VotingBlockHash string // 6 bytes fingerprint of hash of the block that the validator voted for
	PreVoted        bool
	VotedZeroes     bool
	PreCommitVoted  bool
}

Jump to

Keyboard shortcuts

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