Documentation ¶
Index ¶
- type FakeChains
- func (fc *FakeChains) GetLastPath(shardIndex shard.Index) *merkle.MerklePath
- func (fc *FakeChains) GetLedgerInfo(index shard.Index) *wire.LedgerInfo
- func (fc *FakeChains) GetNewBlock(shardIndex shard.Index, txps ...*wire.MsgTxWithProofs) *wire.MsgBlock
- func (fc *FakeChains) GetNewTx(shardIndex shard.Index) *wire.MsgTxWithProofs
- type TxDesc
- type TxPool
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.
type TxDesc ¶
type TxDesc struct { Tx wire.MsgTxWithProofs Priority float64 }
TxDesc contains a Tx and the Tx's priority based on fee.
type TxPool ¶
type TxPool interface { AddNewTransaction(tx *wire.MsgTxWithProofs, root *merkle.MerkleHash) (*TxDesc, error) VerifyTransaction(tx *wire.MsgTxWithProofs, root *merkle.MerkleHash) error GetTopTransactions(number int, update *state.Update, height int64) []*wire.MsgTxWithProofs NumberOfTransactions() int RefreshPool(update *state.Update) }
TxPool is a interface that contains some methods used to add, verify and get transactions with proofs.
Click to show internal directories.
Click to hide internal directories.