Documentation ¶
Index ¶
- Variables
- func GetValByIndex(vals []*types.Validator, blockVersion uint64, idx int) *types.Validator
- func HashCosmosHeader(header types.Header) []byte
- func HashCosmosValSet(valSet *types.ValidatorSet, blockVersion uint64) []byte
- func PutEpochSwitchInfo(service *native.NativeService, chainId uint64, info *CosmosEpochSwitchInfo)
- func RegisterCodec(cdc *codec.Codec)
- func VerifyCosmosHeader(myHeader *CosmosHeader, info *CosmosEpochSwitchInfo) error
- func VoteSignBytes(header *CosmosHeader, valIdx int) []byte
- type CosmosEpochSwitchInfo
- type CosmosHandler
- type CosmosHeader
Constants ¶
This section is empty.
Variables ¶
View Source
var Cdc = codec.New()
Functions ¶
func GetValByIndex ¶ added in v1.8.3
GetValByIndex gets the validator by index depending on tendermint version
func HashCosmosHeader ¶ added in v1.8.3
HashCosmosHeader supports hashing both pre and post stargate tendermint block headers
func HashCosmosValSet ¶ added in v1.8.3
func HashCosmosValSet(valSet *types.ValidatorSet, blockVersion uint64) []byte
HashCosmosHeader supports hashing both pre and post stargate validator sets
func PutEpochSwitchInfo ¶
func PutEpochSwitchInfo(service *native.NativeService, chainId uint64, info *CosmosEpochSwitchInfo)
func RegisterCodec ¶ added in v1.8.3
func VerifyCosmosHeader ¶
func VerifyCosmosHeader(myHeader *CosmosHeader, info *CosmosEpochSwitchInfo) error
func VoteSignBytes ¶ added in v1.8.3
func VoteSignBytes(header *CosmosHeader, valIdx int) []byte
Types ¶
type CosmosEpochSwitchInfo ¶
type CosmosEpochSwitchInfo struct { // The height where validators set changed last time. Poly only accept // header and proof signed by new validators. That means the header // can not be lower than this height. Height int64 // Hash of the block at `Height`. Poly don't save the whole header. // So we can identify the content of this block by `BlockHash`. BlockHash bytes.HexBytes // The hash of new validators set which used to verify validators set // committed with proof. NextValidatorsHash bytes.HexBytes // The cosmos chain-id of this chain basing Cosmos-sdk. ChainID string }
func GetEpochSwitchInfo ¶
func GetEpochSwitchInfo(service *native.NativeService, chainId uint64) (*CosmosEpochSwitchInfo, error)
func (*CosmosEpochSwitchInfo) Deserialization ¶
func (info *CosmosEpochSwitchInfo) Deserialization(source *common.ZeroCopySource) error
func (*CosmosEpochSwitchInfo) Serialization ¶
func (info *CosmosEpochSwitchInfo) Serialization(sink *common.ZeroCopySink)
type CosmosHandler ¶
type CosmosHandler struct{}
func NewCosmosHandler ¶
func NewCosmosHandler() *CosmosHandler
func (*CosmosHandler) SyncBlockHeader ¶
func (this *CosmosHandler) SyncBlockHeader(native *native.NativeService) error
func (*CosmosHandler) SyncCrossChainMsg ¶
func (this *CosmosHandler) SyncCrossChainMsg(native *native.NativeService) error
func (*CosmosHandler) SyncGenesisHeader ¶
func (this *CosmosHandler) SyncGenesisHeader(native *native.NativeService) error
Click to show internal directories.
Click to hide internal directories.