v2

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package v2 is used for tendermint v0.34.22 and its compatible version.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeLightBlockValidationResult

func EncodeLightBlockValidationResult(validatorSetChanged bool, consensusStateBytes []byte) []byte

output: | validatorSetChanged | empty | consensusStateBytesLength | new consensusState | | 1 byte | 23 bytes | 8 bytes | |

Types

type ConsensusState

type ConsensusState struct {
	ChainID              string
	Height               uint64
	NextValidatorSetHash []byte
	ValidatorSet         *types.ValidatorSet
}

func DecodeConsensusState

func DecodeConsensusState(input []byte) (ConsensusState, error)

input: | chainID | height | nextValidatorSetHash | [{validator pubkey, voting power, relayer address, relayer bls pubkey}] | | 32 bytes | 8 bytes | 32 bytes | [{32 bytes, 8 bytes, 20 bytes, 48 bytes}] |

func DecodeLightBlockValidationInput

func DecodeLightBlockValidationInput(input []byte) (*ConsensusState, *types.LightBlock, error)

input: consensus state length | consensus state | light block | 32 bytes | | |

func (*ConsensusState) ApplyLightBlock

func (cs *ConsensusState) ApplyLightBlock(block *types.LightBlock, isHertz bool) (bool, error)

func (ConsensusState) EncodeConsensusState

func (cs ConsensusState) EncodeConsensusState() ([]byte, error)

output: | chainID | height | nextValidatorSetHash | [{validator pubkey, voting power, relayer address, relayer bls pubkey}] | | 32 bytes | 8 bytes | 32 bytes | [{32 bytes, 8 bytes, 20 bytes, 48 bytes}] |

Jump to

Keyboard shortcuts

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