abci

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func EncodeValidatorUpdates

func EncodeValidatorUpdates(v ValidatorUpdates) []string

EncodeValidatorUpdates is the inverse of ParseValidatorUpdates: it formats updates as "<bech32-pubkey>:<decimal-power>" strings, sorted canonically via ValidatorUpdates.Less (pubkey-bytes — see comment at Less above).

Used by the chain's InitChainer (to seed valset:current from genesis validators) and EndBlocker (to write valset:current after applying a proposal). One canonical encoding eliminates drift between the two writers and lets round-trip tests live in one package.

The input is sorted in place. Panics on a nil PubKey at any index — genesis is operator-supplied and a nil pubkey would otherwise nil-deref inside crypto.PubKeyToBech32; panic at InitChainer surfaces as an unrecoverable genesis-misconfig error, which is the correct semantic.

Types

type Application

type Application interface {
	// Info/Query Connection
	Info(RequestInfo) ResponseInfo                // Return application info
	SetOption(RequestSetOption) ResponseSetOption // Set application option
	Query(RequestQuery) ResponseQuery             // Query for state

	// Mempool Connection
	CheckTx(RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool

	// Consensus Connection
	InitChain(RequestInitChain) ResponseInitChain    // Initialize blockchain with validators and other info from TendermintCore
	BeginBlock(RequestBeginBlock) ResponseBeginBlock // Signals the beginning of a block
	DeliverTx(RequestDeliverTx) ResponseDeliverTx    // Deliver a tx for full processing
	EndBlock(RequestEndBlock) ResponseEndBlock       // Signals the end of a block, returns changes to the validator set
	Commit() ResponseCommit                          // Commit the state and return the application Merkle root hash

	// Cleanup
	Close() error
}

Application is an interface that enables any finite, deterministic state machine to be driven by a blockchain-based replication engine via the ABCI. All methods take a RequestXxx argument and return a ResponseXxx argument, except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing.

type BaseApplication

type BaseApplication struct{}

func NewBaseApplication

func NewBaseApplication() *BaseApplication

func (BaseApplication) BeginBlock

func (BaseApplication) CheckTx

func (BaseApplication) Close

func (BaseApplication) Close() error

func (BaseApplication) Commit

func (BaseApplication) DeliverTx

func (BaseApplication) EndBlock

func (BaseApplication) Info

func (BaseApplication) InitChain

func (BaseApplication) Query

func (BaseApplication) SetOption

type BlockParams

type BlockParams struct {
	MaxTxBytes    int64 // must be > 0
	MaxDataBytes  int64 // must be > 0
	MaxBlockBytes int64 // must be > 0
	MaxGas        int64 // must be >= -1
	TimeIotaMS    int64 // must be > 0
}

func (BlockParams) MarshalBinary2

func (goo BlockParams) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (BlockParams) SizeBinary2

func (goo BlockParams) SizeBinary2(cdc *amino.Codec) (int, error)

func (*BlockParams) UnmarshalBinary2

func (goo *BlockParams) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type CheckTxType

type CheckTxType int
const (
	CheckTxTypeNew     CheckTxType = 0
	CheckTxTypeRecheck             = iota
)

type ConsensusParams

type ConsensusParams struct {
	Block     *BlockParams
	Validator *ValidatorParams
}

Parameters that need to be negotiated between the app and consensus.

func (ConsensusParams) Hash

func (params ConsensusParams) Hash() []byte

func (ConsensusParams) MarshalBinary2

func (goo ConsensusParams) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ConsensusParams) SizeBinary2

func (goo ConsensusParams) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ConsensusParams) UnmarshalBinary2

func (goo *ConsensusParams) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

func (ConsensusParams) Update

func (params ConsensusParams) Update(params2 ConsensusParams) ConsensusParams

type Error

type Error interface {
	AssertABCIError()
	Error() string
}

func ABCIErrorOrStringError

func ABCIErrorOrStringError(err error) Error

type Event

type Event interface {
	AssertABCIEvent()
}

type EventString

type EventString string

func (EventString) AssertABCIEvent

func (EventString) AssertABCIEvent()

func (EventString) Event

func (err EventString) Event() string

func (EventString) MarshalBinary2

func (goo EventString) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (EventString) SizeBinary2

func (goo EventString) SizeBinary2(cdc *amino.Codec) (int, error)

func (*EventString) UnmarshalBinary2

func (goo *EventString) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error
type Header interface {
	GetChainID() string
	GetHeight() int64
	GetTime() time.Time
	AssertABCIHeader()
}

type LastCommitInfo

type LastCommitInfo struct {
	Round int32
	Votes []VoteInfo
}

func (LastCommitInfo) MarshalBinary2

func (goo LastCommitInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (LastCommitInfo) SizeBinary2

func (goo LastCommitInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*LastCommitInfo) UnmarshalBinary2

func (goo *LastCommitInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type MockHeader

type MockHeader struct {
	Version  string    `json:"version"`
	ChainID  string    `json:"chain_id"`
	Height   int64     `json:"height"`
	Time     time.Time `json:"time"`
	NumTxs   int64     `json:"num_txs"`
	TotalTxs int64     `json:"total_txs"`
}

Only used for tests.

func (MockHeader) AssertABCIHeader

func (MockHeader) AssertABCIHeader()

func (MockHeader) GetChainID

func (mh MockHeader) GetChainID() string

func (MockHeader) GetHeight

func (mh MockHeader) GetHeight() int64

func (MockHeader) GetTime

func (mh MockHeader) GetTime() time.Time

func (MockHeader) MarshalBinary2

func (goo MockHeader) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (MockHeader) SizeBinary2

func (goo MockHeader) SizeBinary2(cdc *amino.Codec) (int, error)

func (*MockHeader) UnmarshalBinary2

func (goo *MockHeader) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type Request

type Request interface {
	AssertRequest()
}

type RequestBase

type RequestBase struct{}

func (RequestBase) AssertRequest

func (RequestBase) AssertRequest()

func (RequestBase) MarshalBinary2

func (goo RequestBase) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestBase) SizeBinary2

func (goo RequestBase) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestBase) UnmarshalBinary2

func (goo *RequestBase) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestBeginBlock

type RequestBeginBlock struct {
	RequestBase
	Hash           []byte
	Header         Header
	LastCommitInfo *LastCommitInfo
}

func (RequestBeginBlock) MarshalBinary2

func (goo RequestBeginBlock) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestBeginBlock) SizeBinary2

func (goo RequestBeginBlock) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestBeginBlock) UnmarshalBinary2

func (goo *RequestBeginBlock) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestCheckTx

type RequestCheckTx struct {
	RequestBase
	Tx   []byte
	Type CheckTxType
}

func (RequestCheckTx) MarshalBinary2

func (goo RequestCheckTx) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestCheckTx) SizeBinary2

func (goo RequestCheckTx) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestCheckTx) UnmarshalBinary2

func (goo *RequestCheckTx) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestCommit

type RequestCommit struct {
	RequestBase
}

func (RequestCommit) MarshalBinary2

func (goo RequestCommit) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestCommit) SizeBinary2

func (goo RequestCommit) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestCommit) UnmarshalBinary2

func (goo *RequestCommit) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestDeliverTx

type RequestDeliverTx struct {
	RequestBase
	Tx []byte
}

func (RequestDeliverTx) MarshalBinary2

func (goo RequestDeliverTx) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestDeliverTx) SizeBinary2

func (goo RequestDeliverTx) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestDeliverTx) UnmarshalBinary2

func (goo *RequestDeliverTx) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestEcho

type RequestEcho struct {
	RequestBase
	Message string
}

func (RequestEcho) MarshalBinary2

func (goo RequestEcho) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestEcho) SizeBinary2

func (goo RequestEcho) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestEcho) UnmarshalBinary2

func (goo *RequestEcho) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestEndBlock

type RequestEndBlock struct {
	RequestBase
	Height int64
}

func (RequestEndBlock) MarshalBinary2

func (goo RequestEndBlock) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestEndBlock) SizeBinary2

func (goo RequestEndBlock) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestEndBlock) UnmarshalBinary2

func (goo *RequestEndBlock) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestFlush

type RequestFlush struct {
	RequestBase
}

func (RequestFlush) MarshalBinary2

func (goo RequestFlush) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestFlush) SizeBinary2

func (goo RequestFlush) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestFlush) UnmarshalBinary2

func (goo *RequestFlush) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestInfo

type RequestInfo struct {
	RequestBase
}

func (RequestInfo) MarshalBinary2

func (goo RequestInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestInfo) SizeBinary2

func (goo RequestInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestInfo) UnmarshalBinary2

func (goo *RequestInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestInitChain

type RequestInitChain struct {
	RequestBase
	Time            time.Time
	ChainID         string
	ConsensusParams *ConsensusParams
	Validators      []ValidatorUpdate
	AppState        any
	// InitialHeight mirrors GenesisDoc.InitialHeight. 0 or 1 means standard
	// genesis at height 1; >1 means the first produced block has this
	// height (chain upgrade / hardfork replay).
	InitialHeight int64
}

func (RequestInitChain) MarshalBinary2

func (goo RequestInitChain) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestInitChain) SizeBinary2

func (goo RequestInitChain) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestInitChain) UnmarshalBinary2

func (goo *RequestInitChain) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestQuery

type RequestQuery struct {
	RequestBase
	Data   []byte
	Path   string
	Height int64
	Prove  bool
}

func (RequestQuery) MarshalBinary2

func (goo RequestQuery) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestQuery) SizeBinary2

func (goo RequestQuery) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestQuery) UnmarshalBinary2

func (goo *RequestQuery) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type RequestSetOption

type RequestSetOption struct {
	RequestBase
	Key   string
	Value string
}

nondeterministic

func (RequestSetOption) MarshalBinary2

func (goo RequestSetOption) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (RequestSetOption) SizeBinary2

func (goo RequestSetOption) SizeBinary2(cdc *amino.Codec) (int, error)

func (*RequestSetOption) UnmarshalBinary2

func (goo *RequestSetOption) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type Response

type Response interface {
	AssertResponse()
}

type ResponseBase

type ResponseBase struct {
	Error  Error
	Data   []byte
	Events []Event

	Log  string // nondeterministic
	Info string // nondeterministic
}

func (ResponseBase) AssertResponse

func (ResponseBase) AssertResponse()

func (ResponseBase) EncodeEvents

func (r ResponseBase) EncodeEvents() []byte

func (ResponseBase) IsErr

func (r ResponseBase) IsErr() bool

func (ResponseBase) IsOK

func (r ResponseBase) IsOK() bool

func (ResponseBase) MarshalBinary2

func (goo ResponseBase) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseBase) SizeBinary2

func (goo ResponseBase) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseBase) UnmarshalBinary2

func (goo *ResponseBase) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseBeginBlock

type ResponseBeginBlock struct {
	ResponseBase
}

func (ResponseBeginBlock) MarshalBinary2

func (goo ResponseBeginBlock) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseBeginBlock) SizeBinary2

func (goo ResponseBeginBlock) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseBeginBlock) UnmarshalBinary2

func (goo *ResponseBeginBlock) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseCheckTx

type ResponseCheckTx struct {
	ResponseBase
	GasWanted int64 // nondeterministic
	GasUsed   int64
}

func (ResponseCheckTx) MarshalBinary2

func (goo ResponseCheckTx) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseCheckTx) SizeBinary2

func (goo ResponseCheckTx) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseCheckTx) UnmarshalBinary2

func (goo *ResponseCheckTx) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseCommit

type ResponseCommit struct {
	ResponseBase
}

func (ResponseCommit) MarshalBinary2

func (goo ResponseCommit) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseCommit) SizeBinary2

func (goo ResponseCommit) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseCommit) UnmarshalBinary2

func (goo *ResponseCommit) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseDeliverTx

type ResponseDeliverTx struct {
	ResponseBase
	GasWanted int64
	GasUsed   int64
}

func (ResponseDeliverTx) MarshalBinary2

func (goo ResponseDeliverTx) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseDeliverTx) SizeBinary2

func (goo ResponseDeliverTx) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseDeliverTx) UnmarshalBinary2

func (goo *ResponseDeliverTx) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseEcho

type ResponseEcho struct {
	ResponseBase
	Message string
}

func (ResponseEcho) MarshalBinary2

func (goo ResponseEcho) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseEcho) SizeBinary2

func (goo ResponseEcho) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseEcho) UnmarshalBinary2

func (goo *ResponseEcho) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseEndBlock

type ResponseEndBlock struct {
	ResponseBase
	ValidatorUpdates []ValidatorUpdate
	ConsensusParams  *ConsensusParams
	Events           []Event
}

func (ResponseEndBlock) MarshalBinary2

func (goo ResponseEndBlock) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseEndBlock) SizeBinary2

func (goo ResponseEndBlock) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseEndBlock) UnmarshalBinary2

func (goo *ResponseEndBlock) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseException

type ResponseException struct {
	ResponseBase
}

nondeterministic

func (ResponseException) MarshalBinary2

func (goo ResponseException) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseException) SizeBinary2

func (goo ResponseException) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseException) UnmarshalBinary2

func (goo *ResponseException) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseFlush

type ResponseFlush struct {
	ResponseBase
}

func (ResponseFlush) MarshalBinary2

func (goo ResponseFlush) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseFlush) SizeBinary2

func (goo ResponseFlush) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseFlush) UnmarshalBinary2

func (goo *ResponseFlush) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseInfo

type ResponseInfo struct {
	ResponseBase
	ABCIVersion      string
	AppVersion       string
	LastBlockHeight  int64
	LastBlockAppHash []byte
}

func (ResponseInfo) MarshalBinary2

func (goo ResponseInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseInfo) SizeBinary2

func (goo ResponseInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseInfo) UnmarshalBinary2

func (goo *ResponseInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseInitChain

type ResponseInitChain struct {
	ResponseBase
	ConsensusParams *ConsensusParams
	Validators      []ValidatorUpdate
	TxResponses     []ResponseDeliverTx
}

func (ResponseInitChain) MarshalBinary2

func (goo ResponseInitChain) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseInitChain) SizeBinary2

func (goo ResponseInitChain) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseInitChain) UnmarshalBinary2

func (goo *ResponseInitChain) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseQuery

type ResponseQuery struct {
	ResponseBase
	Key    []byte
	Value  []byte
	Proof  *merkle.Proof
	Height int64
}

func (ResponseQuery) MarshalBinary2

func (goo ResponseQuery) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseQuery) SizeBinary2

func (goo ResponseQuery) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseQuery) UnmarshalBinary2

func (goo *ResponseQuery) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ResponseSetOption

type ResponseSetOption struct {
	ResponseBase
}

nondeterministic

func (ResponseSetOption) MarshalBinary2

func (goo ResponseSetOption) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ResponseSetOption) SizeBinary2

func (goo ResponseSetOption) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ResponseSetOption) UnmarshalBinary2

func (goo *ResponseSetOption) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type StringError

type StringError string

func (StringError) AssertABCIError

func (StringError) AssertABCIError()

func (StringError) Error

func (err StringError) Error() string

func (StringError) MarshalBinary2

func (goo StringError) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (StringError) SizeBinary2

func (goo StringError) SizeBinary2(cdc *amino.Codec) (int, error)

func (*StringError) UnmarshalBinary2

func (goo *StringError) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ValidatorParams

type ValidatorParams struct {
	PubKeyTypeURLs []string
}

func (ValidatorParams) IsValidPubKeyTypeURL

func (params ValidatorParams) IsValidPubKeyTypeURL(pubKeyTypeURL string) bool

func (ValidatorParams) MarshalBinary2

func (goo ValidatorParams) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ValidatorParams) SizeBinary2

func (goo ValidatorParams) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ValidatorParams) UnmarshalBinary2

func (goo *ValidatorParams) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ValidatorUpdate

type ValidatorUpdate struct {
	Address crypto.Address
	PubKey  crypto.PubKey
	Power   int64
}

func ParseValidatorUpdate

func ParseValidatorUpdate(entry string) (ValidatorUpdate, error)

ParseValidatorUpdate parses a single "<pubkey>:<power>" entry. Address is derived from the pubkey; powers are non-negative and capped at math.MaxInt64 so the int64 cast can't overflow.

func (ValidatorUpdate) Equals

func (vu ValidatorUpdate) Equals(vu2 ValidatorUpdate) bool

func (ValidatorUpdate) MarshalBinary2

func (goo ValidatorUpdate) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ValidatorUpdate) SizeBinary2

func (goo ValidatorUpdate) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ValidatorUpdate) UnmarshalBinary2

func (goo *ValidatorUpdate) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ValidatorUpdates

type ValidatorUpdates []ValidatorUpdate

ValidatorUpdates is a list of validators that implements the Sort interface

func ParseValidatorUpdates

func ParseValidatorUpdates(entries []string) (ValidatorUpdates, error)

ParseValidatorUpdates parses a list of "<pubkey>:<power>" entries. Errors carry the offending entry index.

func (ValidatorUpdates) Len

func (v ValidatorUpdates) Len() int

func (ValidatorUpdates) Less

func (v ValidatorUpdates) Less(i, j int) bool

func (ValidatorUpdates) Swap

func (v ValidatorUpdates) Swap(i, j int)

func (ValidatorUpdates) UpdatesFrom

UpdatesFrom compares this ValidatorUpdates set with another (v2) and returns a new ValidatorUpdates containing only the changes needed to go from the receiver to v2. It includes:

  1. Removals: validators present in the receiver but missing in v2 (Power = 0).
  2. Power changes: validators present in both but whose Power differs.
  3. Additions: validators present in v2 but missing in the receiver.

type VoteInfo

type VoteInfo struct {
	Address         crypto.Address
	Power           int64
	SignedLastBlock bool
}

unstable

func (VoteInfo) MarshalBinary2

func (goo VoteInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (VoteInfo) SizeBinary2

func (goo VoteInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*VoteInfo) UnmarshalBinary2

func (goo *VoteInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

Jump to

Keyboard shortcuts

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