testpartition

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: AGPL-3.0 Imports: 36 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(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 (*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 NewPartition(t *testing.T, nodeCount uint8, txSystemProvider func(trustBase map[string]abcrypto.Verifier) txsystem.TransactionSystem, systemIdentifier types.SystemID, state *state.State) (abPartition *NodePartition, err error)

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 (*NodePartition) SubmitTx added in v0.2.0

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

SubmitTx sends transactions to the first node.

type RootPartition added in v0.2.0

type RootPartition struct {
	TrustBase map[string]abcrypto.Verifier
	Nodes     []*rootNode
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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