interfaces

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: GPL-3.0, GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Validate    IValidate
	HeaderStore IHeaderStore
}

func (*Chain) GetCurrentNumberAndHash

func (c *Chain) GetCurrentNumberAndHash(db types.StateDB) (uint64, common.Hash, error)

func (*Chain) GetHashByNumber

func (c *Chain) GetHashByNumber(db types.StateDB, number uint64) (common.Hash, error)

func (*Chain) InsertHeaders

func (c *Chain) InsertHeaders(db types.StateDB, headers []byte) ([]*params.NumberHash, error)

func (*Chain) ResetHeaderStore

func (c *Chain) ResetHeaderStore(db types.StateDB, header []byte, td *big.Int) error

func (*Chain) ValidateHeaderChain

func (c *Chain) ValidateHeaderChain(db types.StateDB, headers []byte, chainType chains.ChainType) (int, error)

type IChain

type IChain interface {
	IValidate
	IHeaderStore
}

func ChainFactory

func ChainFactory(group chains.ChainGroup) (IChain, error)

type IHeaderStore

type IHeaderStore interface {
	ResetHeaderStore(db types.StateDB, header []byte, td *big.Int) error
	InsertHeaders(db types.StateDB, headers []byte) ([]*params.NumberHash, error)
	GetCurrentNumberAndHash(db types.StateDB) (uint64, common.Hash, error)
	GetHashByNumber(db types.StateDB, number uint64) (common.Hash, error)
}

func HeaderStoreFactory

func HeaderStoreFactory(group chains.ChainGroup) (IHeaderStore, error)

type IValidate

type IValidate interface {
	ValidateHeaderChain(db types.StateDB, headers []byte, chainType chains.ChainType) (int, error)
}

func ValidateFactory

func ValidateFactory(group chains.ChainGroup) (IValidate, error)

type IVerify

type IVerify interface {
	Verify(db types.StateDB, router common.Address, txProveBytes []byte) (logs []byte, err error)
}

func VerifyFactory

func VerifyFactory(group chains.ChainGroup) (IVerify, error)

type StoreLoad

type StoreLoad interface {
	Store(db types.StateDB) error
	Load(db types.StateDB) error
}

type Validate

type Validate interface {
}

Jump to

Keyboard shortcuts

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