starcoin

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

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 IsHeaderExist(native *native.NativeService, hash []byte, chainID uint64) (bool, error)

func ReStructChain

func ReStructChain(native *native.NativeService, current, new *types.BlockHeaderAndBlockInfo, chainID uint64) error

Types

type BlockDiffInfo

type BlockDiffInfo struct {
	Timestamp uint64
	Target    uint256.Int
}

type Handler

type Handler struct {
}

Handler ...

func NewSTCHandler

func NewSTCHandler() *Handler

NewSTCHandler ...

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 ...

Jump to

Keyboard shortcuts

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