Documentation ¶
Index ¶
- func FillBS(t *testing.T, bServ blockservice.BlockService, shares []share.Share) *share.Root
- func NewTestBrokenAvailability() share.Availability
- func NewTestSuccessfulAvailability() share.Availability
- func RandFillBS(t *testing.T, n int, bServ blockservice.BlockService) *share.Root
- type DagNet
- type Node
- type SubNet
- type TestBrokenAvailability
- type TestSuccessfulAvailability
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestBrokenAvailability ¶
func NewTestBrokenAvailability() share.Availability
NewTestBrokenAvailability returns an instance of Availability that allows for testing error cases during sampling.
If the share.Root field is empty, it will return share.ErrNotAvailable on every call to SharesAvailable. Otherwise, it will only return ErrNotAvailable if the given Root hash matches the stored Root hash.
func NewTestSuccessfulAvailability ¶
func NewTestSuccessfulAvailability() share.Availability
NewTestSuccessfulAvailability returns an Availability that always returns successfully when SharesAvailable is called.
Types ¶
type DagNet ¶
func NewTestDAGNet ¶
NewTestDAGNet creates a new testing swarm utility to spawn different nodes and test how they interact and/or exchange data.
func (*DagNet) ConnectAll ¶
func (dn *DagNet) ConnectAll()
ConnectAll connects all the peers on registered on the DagNet.
func (*DagNet) Disconnect ¶
Disconnect disconnects two peers. It does a hard disconnect, meaning that disconnected peers won't be able to reconnect on their own but only with DagNet.Connect or DagNet.ConnectAll.
type Node ¶
func (*Node) ClearStorage ¶
func (n *Node) ClearStorage()
ClearStorage cleans up the storage of the node.
type SubNet ¶
type SubNet struct { *DagNet // contains filtered or unexported fields }
func (*SubNet) ConnectAll ¶
func (sn *SubNet) ConnectAll()
type TestBrokenAvailability ¶
func (*TestBrokenAvailability) ProbabilityOfAvailability ¶
func (b *TestBrokenAvailability) ProbabilityOfAvailability() float64
func (*TestBrokenAvailability) SharesAvailable ¶
type TestSuccessfulAvailability ¶
type TestSuccessfulAvailability struct { }
func (*TestSuccessfulAvailability) ProbabilityOfAvailability ¶
func (tsa *TestSuccessfulAvailability) ProbabilityOfAvailability() float64