testpartition

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2025 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockchainContains added in v0.1.1

func BlockchainContains(t *testing.T, shard *Shard, criteria func(txr *types.TransactionRecord) bool) func() bool

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

func BlockchainContainsTx(t *testing.T, shard *Shard, tx *types.TransactionOrder) func() bool

BlockchainContainsTx checks if at least one shard node block contains the given transaction.

func ShardInitReady added in v1.0.0

func ShardInitReady(t *testing.T, shard *Shard) func() bool

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 (*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

func (*Shard) SubmitTx added in v1.0.0

func (n *Shard) SubmitTx(tx *types.TransactionOrder) error

SubmitTx sends transactions to the first node.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL