Documentation ¶
Index ¶
- Constants
- Variables
- func GetCurrentHeader(native *native.NativeService, chainID uint64) (*types.BlockHeaderAndBlockInfo, error)
- func GetCurrentHeaderHeight(native *native.NativeService, chainID uint64) (uint64, error)
- func GetGenesisBlockHeader(native *native.NativeService, chainID uint64) (*types.BlockHeaderAndBlockInfo, error)
- func GetHeaderByHash(native *native.NativeService, hash []byte, chainID uint64) (*types.BlockHeaderAndBlockInfo, error)
- func GetHeaderByHeight(native *native.NativeService, height, chainID uint64) (*types.BlockHeaderAndBlockInfo, error)
- func IsHeaderExist(native *native.NativeService, hash []byte, chainID uint64) (bool, error)
- func ReStructChain(native *native.NativeService, current, new *types.BlockHeaderAndBlockInfo, ...) error
- type BlockDiffInfo
- type Handler
Constants ¶
View Source
const (
// don't modify this, which trigger relayer rollback to common ancestor.
GET_PARENT_BLOCK_FAILED_FORMAT = "SyncBlockHeader, get the parent block failed. Error:%s, header: %s"
)
Variables ¶
View Source
var MAXU256 = &big.Int{}
Functions ¶
func GetCurrentHeader ¶
func GetCurrentHeader(native *native.NativeService, chainID uint64) (*types.BlockHeaderAndBlockInfo, error)
func GetCurrentHeaderHeight ¶
func GetCurrentHeaderHeight(native *native.NativeService, chainID uint64) (uint64, error)
func GetGenesisBlockHeader ¶
func GetGenesisBlockHeader(native *native.NativeService, chainID uint64) (*types.BlockHeaderAndBlockInfo, error)
func GetHeaderByHash ¶
func GetHeaderByHash(native *native.NativeService, hash []byte, chainID uint64) (*types.BlockHeaderAndBlockInfo, error)
func GetHeaderByHeight ¶
func GetHeaderByHeight(native *native.NativeService, height, chainID uint64) (*types.BlockHeaderAndBlockInfo, error)
func IsHeaderExist ¶
func ReStructChain ¶
func ReStructChain(native *native.NativeService, current, new *types.BlockHeaderAndBlockInfo, chainID uint64) error
Types ¶
type BlockDiffInfo ¶
type Handler ¶
type Handler struct { }
Handler ...
func (*Handler) SyncBlockHeader ¶
func (h *Handler) SyncBlockHeader(native *native.NativeService) error
func (*Handler) SyncCrossChainMsg ¶
func (h *Handler) SyncCrossChainMsg(native *native.NativeService) error
func (*Handler) SyncGenesisHeader ¶
func (h *Handler) SyncGenesisHeader(native *native.NativeService) (err error)
SyncGenesisHeader ...
Click to show internal directories.
Click to hide internal directories.