testpartition

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockchainContains

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 WaitTxProof

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

func WaitUnitProof(t *testing.T, part *NodePartition, ID types.UnitID, txOrder *types.TransactionOrder) (*types.UnitDataAndProof, error)

Types

type AlphabillNetwork

type AlphabillNetwork struct {
	NodePartitions map[types.SystemID]*NodePartition
	RootPartition  *RootPartition
	// contains filtered or unexported fields
}

AlphabillNetwork for integration tests

func NewAlphabillPartition

func NewAlphabillPartition(nodePartitions []*NodePartition) (*AlphabillNetwork, error)

func NewMultiRootAlphabillPartition

func NewMultiRootAlphabillPartition(nofRootNodes uint8, nodePartitions []*NodePartition) (*AlphabillNetwork, error)

func (*AlphabillNetwork) Close

func (a *AlphabillNetwork) Close() (err error)

func (*AlphabillNetwork) GetNodePartition

func (a *AlphabillNetwork) GetNodePartition(sysID types.SystemID) (*NodePartition, error)

func (*AlphabillNetwork) GetValidator

func (*AlphabillNetwork) Start

func (a *AlphabillNetwork) Start(t *testing.T) error

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 NodePartition

type NodePartition struct {
	SystemName string

	Nodes []*PartitionNode
	// contains filtered or unexported fields
}

func NewPartition

func NewPartition(t *testing.T, systemName string, nodeCount uint8, txSystemProvider func(trustBase map[string]abcrypto.Verifier) txsystem.TransactionSystem, systemIdentifier types.SystemID, state *state.State) (abPartition *NodePartition, err error)

func (*NodePartition) BroadcastTx

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

BroadcastTx sends transactions to all nodes.

func (*NodePartition) GetTxProof

func (*NodePartition) SubmitTx

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

SubmitTx sends transactions to the first node.

type PartitionNode added in v0.4.0

type PartitionNode struct {
	*partition.Node

	EventHandler *testevent.TestEventHandler

	AddrGRPC string
	AddrRPC  string

	OwnerIndexer *partition.OwnerIndexer
	// contains filtered or unexported fields
}

func (*PartitionNode) Stop added in v0.4.0

func (pn *PartitionNode) Stop() error

type RootPartition

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