Documentation ¶
Index ¶
- func BlockchainContains(part *NodePartition, criteria func(tx *types.TransactionOrder) bool) func() bool
- func BlockchainContainsTx(part *NodePartition, tx *types.TransactionOrder) func() bool
- func PartitionInitReady(t *testing.T, part *NodePartition) func() bool
- func WaitTxProof(t *testing.T, part *NodePartition, txOrder *types.TransactionOrder) (*types.TransactionRecord, *types.TxProof, error)
- func WaitUnitProof(t *testing.T, part *NodePartition, ID types.UnitID, ...) (*types.UnitDataAndProof, error)
- type AlphabillNetwork
- func (a *AlphabillNetwork) Close() (err error)
- func (a *AlphabillNetwork) GetNodePartition(sysID types.SystemID) (*NodePartition, error)
- func (a *AlphabillNetwork) GetValidator(sysID types.SystemID) (partition.UnicityCertificateValidator, error)
- func (a *AlphabillNetwork) Start(t *testing.T) error
- func (a *AlphabillNetwork) StartWithStandAloneBootstrapNodes(t *testing.T) error
- func (a *AlphabillNetwork) WaitClose(t *testing.T)
- type NodePartition
- type RootPartition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockchainContains ¶ added in v0.1.1
func BlockchainContains(part *NodePartition, criteria func(tx *types.TransactionOrder) bool) func() bool
func BlockchainContainsTx ¶
func BlockchainContainsTx(part *NodePartition, tx *types.TransactionOrder) func() bool
BlockchainContainsTx checks if at least one partition node block contains the given transaction.
func PartitionInitReady ¶ added in v0.4.0
func PartitionInitReady(t *testing.T, part *NodePartition) func() bool
PartitionInitReady - all nodes are in normal state and return a latest block number
func WaitTxProof ¶ added in v0.3.0
func WaitTxProof(t *testing.T, part *NodePartition, txOrder *types.TransactionOrder) (*types.TransactionRecord, *types.TxProof, error)
WaitTxProof - wait for proof from any validator in partition. If one has the proof it does not mean all have processed the UC. Returns both transaction record and proof when tx has been executed and added to block
func WaitUnitProof ¶ added in v0.3.0
func WaitUnitProof(t *testing.T, part *NodePartition, ID types.UnitID, txOrder *types.TransactionOrder) (*types.UnitDataAndProof, error)
Types ¶
type AlphabillNetwork ¶ added in v0.2.0
type AlphabillNetwork struct { NodePartitions map[types.SystemID]*NodePartition RootPartition *RootPartition BootNodes []*network.Peer BootStrapInfo []peer.AddrInfo // contains filtered or unexported fields }
AlphabillNetwork for integration tests
func NewAlphabillPartition ¶ added in v0.2.0
func NewAlphabillPartition(nodePartitions []*NodePartition) (*AlphabillNetwork, error)
func NewMultiRootAlphabillPartition ¶ added in v0.3.0
func NewMultiRootAlphabillPartition(nofRootNodes uint8, nodePartitions []*NodePartition) (*AlphabillNetwork, error)
func (*AlphabillNetwork) Close ¶ added in v0.2.0
func (a *AlphabillNetwork) Close() (err error)
func (*AlphabillNetwork) GetNodePartition ¶ added in v0.2.0
func (a *AlphabillNetwork) GetNodePartition(sysID types.SystemID) (*NodePartition, error)
func (*AlphabillNetwork) GetValidator ¶ added in v0.3.0
func (a *AlphabillNetwork) GetValidator(sysID types.SystemID) (partition.UnicityCertificateValidator, error)
func (*AlphabillNetwork) Start ¶ added in v0.2.0
func (a *AlphabillNetwork) Start(t *testing.T) error
Start AB network, no bootstrap all id's and addresses are injected to peer store at start
func (*AlphabillNetwork) StartWithStandAloneBootstrapNodes ¶ added in v0.4.0
func (a *AlphabillNetwork) StartWithStandAloneBootstrapNodes(t *testing.T) error
StartWithStandAloneBootstrapNodes - starts AB network with dedicated bootstrap nodes
func (*AlphabillNetwork) WaitClose ¶ added in v0.3.0
func (a *AlphabillNetwork) WaitClose(t *testing.T)
WaitClose closes the AB network and waits for all the nodes to stop. It fails the test "t" if nodes do not stop/exit within timeout.
type NodePartition ¶ added in v0.2.0
type NodePartition struct { Nodes []*partitionNode // contains filtered or unexported fields }
func NewPartition ¶ added in v0.2.0
func (*NodePartition) BroadcastTx ¶ added in v0.2.0
func (n *NodePartition) BroadcastTx(tx *types.TransactionOrder) error
BroadcastTx sends transactions to all nodes.
func (*NodePartition) GetTxProof ¶ added in v0.2.0
func (n *NodePartition) GetTxProof(tx *types.TransactionOrder) (*types.Block, *types.TxProof, *types.TransactionRecord, error)
func (*NodePartition) SubmitTx ¶ added in v0.2.0
func (n *NodePartition) SubmitTx(tx *types.TransactionOrder) error
SubmitTx sends transactions to the first node.