mock

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: AGPL-3.0 Imports: 10 Imported by: 1

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

func NewCrosschainTx added in v0.2.0

func NewCrosschainTx(privateKey string) *types.Tx

Types

type Chain

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

func NewChain

func NewChain(mempool *Mempool) *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) GetTransactionStatus

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

func (*Chain) InMainChain

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

func (*Chain) LastIrreversibleHeader added in v0.3.0

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

func (*Chain) ProcessBlock

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

func (*Chain) ProcessBlockSignature added in v1.0.2

func (c *Chain) ProcessBlockSignature(signature, pubkey []byte, blockHash *bc.Hash) error

TODO:

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(tx *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 added in v1.0.5

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