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 ¶ added in v0.1.1
func BlockchainContainsSuccessfulTx ¶ added in v1.0.0
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 ¶ added in v1.0.0
ShardInitReady - all nodes are in normal state and return the latest block number
func WaitTxProof ¶ added in v0.3.0
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 ¶ added in v0.3.0
func WaitUnitProof(t *testing.T, shard *Shard, ID types.UnitID, txOrder *types.TransactionOrder) (*types.UnitStateWithProof, error)
Types ¶
type AlphabillNetwork ¶ added in v0.2.0
type AlphabillNetwork struct {
RootChain *RootChain
Shards map[types.PartitionShardID]*Shard
// contains filtered or unexported fields
}
AlphabillNetwork for integration tests
func NewAlphabillNetwork ¶ added in v1.0.0
func NewAlphabillNetwork(t *testing.T, rootNodeCount int) *AlphabillNetwork
func (*AlphabillNetwork) AddShard ¶ added in v1.0.0
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 ¶ added in v0.2.0
func (a *AlphabillNetwork) Close() (retErr error)
func (*AlphabillNetwork) GetShard ¶ added in v1.0.0
func (a *AlphabillNetwork) GetShard(psID types.PartitionShardID) (*Shard, error)
func (*AlphabillNetwork) GetValidator ¶ added in v0.3.0
func (a *AlphabillNetwork) GetValidator(psID types.PartitionShardID) (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) 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 RootChain ¶ added in v1.0.0
type RootChain struct {
TrustBase types.RootTrustBase
// contains filtered or unexported fields
}
type Shard ¶ added in v1.0.0
type Shard struct {
Nodes []*shardNode
// contains filtered or unexported fields
}
func (*Shard) BroadcastTx ¶ added in v1.0.0
func (n *Shard) BroadcastTx(tx *types.TransactionOrder) error
BroadcastTx sends transactions to all nodes.
func (*Shard) GetTxProof ¶ added in v1.0.0
func (n *Shard) GetTxProof(t *testing.T, tx *types.TransactionOrder) (*types.Block, *types.TxRecordProof, error)
func (*Shard) PartitionShardID ¶ added in v1.0.0
func (s *Shard) PartitionShardID() types.PartitionShardID