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 RootChain
- type Shard
- type UnicityNetwork
- func (a *UnicityNetwork) AddShard(t *testing.T, shardConf *types.PartitionDescriptionRecord, nodeCount int, ...)
- func (a *UnicityNetwork) Close() (retErr error)
- func (a *UnicityNetwork) GetShard(psID types.PartitionShardID) (*Shard, error)
- func (a *UnicityNetwork) GetValidator(psID types.PartitionShardID) (partition.UnicityCertificateValidator, error)
- func (a *UnicityNetwork) Start(t *testing.T) error
- func (a *UnicityNetwork) WaitClose(t *testing.T)
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 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
type UnicityNetwork ¶
type UnicityNetwork struct {
RootChain *RootChain
Shards map[types.PartitionShardID]*Shard
// contains filtered or unexported fields
}
UnicityNetwork for integration tests
func NewUnicityNetwork ¶
func NewUnicityNetwork(t *testing.T, rootNodeCount int) *UnicityNetwork
func (*UnicityNetwork) AddShard ¶
func (a *UnicityNetwork) AddShard(t *testing.T, shardConf *types.PartitionDescriptionRecord, nodeCount int, txSystemProvider txSystemProvider)
Adds a shard to a running UnicityNetwork instance
func (*UnicityNetwork) Close ¶
func (a *UnicityNetwork) Close() (retErr error)
func (*UnicityNetwork) GetShard ¶
func (a *UnicityNetwork) GetShard(psID types.PartitionShardID) (*Shard, error)
func (*UnicityNetwork) GetValidator ¶
func (a *UnicityNetwork) GetValidator(psID types.PartitionShardID) (partition.UnicityCertificateValidator, error)
func (*UnicityNetwork) Start ¶
func (a *UnicityNetwork) Start(t *testing.T) error
Start AB network, no bootstrap all id's and addresses are injected to peer store at start
func (*UnicityNetwork) WaitClose ¶
func (a *UnicityNetwork) 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.