Documentation
¶
Index ¶
- func BlockchainContains(t *testing.T, shard *Shard, criteria func(txr *types.TransactionRecord) bool) func() bool
- func BlockchainContainsSuccessfulTx(t *testing.T, shard *Shard, tx *types.TransactionOrder) func() bool
- func BlockchainContainsTx(t *testing.T, shard *Shard, tx *types.TransactionOrder) func() bool
- func ShardInitReady(t *testing.T, shard *Shard) func() bool
- func WaitTxProof(t *testing.T, shard *Shard, txOrder *types.TransactionOrder) (*types.TxRecordProof, error)
- func WaitUnitProof(t *testing.T, shard *Shard, ID types.UnitID, txOrder *types.TransactionOrder) (*types.UnitStateWithProof, error)
- type AlphabillNetwork
- func (a *AlphabillNetwork) AddShard(t *testing.T, shardConf *types.PartitionDescriptionRecord, nodeCount int, ...)
- func (a *AlphabillNetwork) Close() (retErr error)
- func (a *AlphabillNetwork) GetShard(psID types.PartitionShardID) (*Shard, error)
- func (a *AlphabillNetwork) GetValidator(psID types.PartitionShardID) (partition.UnicityCertificateValidator, error)
- func (a *AlphabillNetwork) Start(t *testing.T) error
- func (a *AlphabillNetwork) WaitClose(t *testing.T)
- type RootChain
- type Shard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockchainContains ¶
func BlockchainContainsSuccessfulTx ¶
func BlockchainContainsSuccessfulTx(t *testing.T, shard *Shard, tx *types.TransactionOrder) func() bool
BlockchainContainsSuccessfulTx checks if at least one shard node has successfully executed the given transaction.
func BlockchainContainsTx ¶
BlockchainContainsTx checks if at least one shard node block contains the given transaction.
func ShardInitReady ¶
ShardInitReady - all nodes are in normal state and return the latest block number
func WaitTxProof ¶
func WaitTxProof(t *testing.T, shard *Shard, txOrder *types.TransactionOrder) (*types.TxRecordProof, error)
WaitTxProof - wait for proof from any validator in a shard. 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 ¶
func WaitUnitProof(t *testing.T, shard *Shard, ID types.UnitID, txOrder *types.TransactionOrder) (*types.UnitStateWithProof, error)
Types ¶
type AlphabillNetwork ¶
type AlphabillNetwork struct {
RootChain *RootChain
Shards map[types.PartitionShardID]*Shard
// contains filtered or unexported fields
}
AlphabillNetwork for integration tests
func NewAlphabillNetwork ¶
func NewAlphabillNetwork(t *testing.T, rootNodeCount int) *AlphabillNetwork
func (*AlphabillNetwork) AddShard ¶
func (a *AlphabillNetwork) AddShard(t *testing.T, shardConf *types.PartitionDescriptionRecord, nodeCount int, txSystemProvider txSystemProvider)
Adds a shard to a running AlphabillNetwork instance
func (*AlphabillNetwork) Close ¶
func (a *AlphabillNetwork) Close() (retErr error)
func (*AlphabillNetwork) GetShard ¶
func (a *AlphabillNetwork) GetShard(psID types.PartitionShardID) (*Shard, error)
func (*AlphabillNetwork) GetValidator ¶
func (a *AlphabillNetwork) GetValidator(psID types.PartitionShardID) (partition.UnicityCertificateValidator, error)
func (*AlphabillNetwork) Start ¶
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) WaitClose ¶
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 RootChain ¶
type RootChain struct {
TrustBase types.RootTrustBase
// contains filtered or unexported fields
}
type Shard ¶
type Shard struct {
Nodes []*shardNode
// contains filtered or unexported fields
}
func (*Shard) BroadcastTx ¶
func (n *Shard) BroadcastTx(tx *types.TransactionOrder) error
BroadcastTx sends transactions to all nodes.
func (*Shard) GetTxProof ¶
func (n *Shard) GetTxProof(t *testing.T, tx *types.TransactionOrder) (*types.Block, *types.TxRecordProof, error)
func (*Shard) PartitionShardID ¶
func (s *Shard) PartitionShardID() types.PartitionShardID