testingutils

package
v0.0.0-...-4f0ab6e Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeChains

type FakeChains struct {
	ShardHeight map[shard.Index]int64
	Chains      map[shard.Index]*fakeChain
	// contains filtered or unexported fields
}

FakeChains is a fake struct for test.

func NewFakeChains

func NewFakeChains() *FakeChains

NewFakeChains generates a fake chains for test.

func (*FakeChains) GetLastPath

func (fc *FakeChains) GetLastPath(shardIndex shard.Index) *merkle.MerklePath

GetLastPath Returns the last path of the ledger tree for given shard.

func (*FakeChains) GetLedgerInfo

func (fc *FakeChains) GetLedgerInfo(index shard.Index) *wire.LedgerInfo

GetLedgerInfo Returns a LedgerInfo struct contains the current height of each shard and total size.

func (*FakeChains) GetNewBlock

func (fc *FakeChains) GetNewBlock(shardIndex shard.Index, txps ...*wire.MsgTxWithProofs) *wire.MsgBlock

GetNewBlock returns a new MsgBlock given a shardIndex and some MsgTxWithProofs.

func (*FakeChains) GetNewTx

func (fc *FakeChains) GetNewTx(shardIndex shard.Index) *wire.MsgTxWithProofs

GetNewTx Generate a Tx with proofs. The inputs will be deleted immediately form the fake chains.

Jump to

Keyboard shortcuts

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