mock

package
v0.0.0-...-829742f Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFoundHeaderByHash   = errors.New("can't find header by hash")
	ErrFoundHeaderByHeight = errors.New("can't find header by height")
)

Functions

This section is empty.

Types

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

func NewChain

func NewChain() *Chain

func (*Chain) BestBlockHeader

func (c *Chain) BestBlockHeader() *types.BlockHeader

func (*Chain) BestBlockHeight

func (c *Chain) BestBlockHeight() uint64

func (*Chain) CalcNextSeed

func (c *Chain) CalcNextSeed(hash *bc.Hash) (*bc.Hash, error)

func (*Chain) GetBlockByHash

func (c *Chain) GetBlockByHash(hash *bc.Hash) (*types.Block, error)

func (*Chain) GetBlockByHeight

func (c *Chain) GetBlockByHeight(height uint64) (*types.Block, error)

func (*Chain) GetHeaderByHash

func (c *Chain) GetHeaderByHash(hash *bc.Hash) (*types.BlockHeader, error)

func (*Chain) GetHeaderByHeight

func (c *Chain) GetHeaderByHeight(height uint64) (*types.BlockHeader, error)

func (*Chain) InMainChain

func (c *Chain) InMainChain(hash bc.Hash) bool

func (*Chain) LastJustifiedHeader

func (c *Chain) LastJustifiedHeader() (*types.BlockHeader, error)

func (*Chain) ProcessBlock

func (c *Chain) ProcessBlock(block *types.Block) (bool, error)

func (*Chain) SetBestBlockHeader

func (c *Chain) SetBestBlockHeader(header *types.BlockHeader)

func (*Chain) SetBlockByHeight

func (c *Chain) SetBlockByHeight(height uint64, block *types.Block)

func (*Chain) ValidateTx

func (c *Chain) ValidateTx(*types.Tx) (bool, error)

type Mempool

type Mempool struct {
	// contains filtered or unexported fields
}

func (*Mempool) AddTx

func (m *Mempool) AddTx(tx *types.Tx)

func (*Mempool) GetTransactions

func (m *Mempool) GetTransactions() []*protocol.TxDesc

func (*Mempool) IsDust

func (m *Mempool) IsDust(tx *types.Tx) bool

Jump to

Keyboard shortcuts

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