swamp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Components

type Components struct {
	App     types.Application
	CoreCfg *tn.Config
}

Components struct represents a set of pre-requisite attributes from the test scenario

func DefaultComponents

func DefaultComponents() *Components

DefaultComponents creates a KvStore with a block retention of 200 In addition, the empty block interval is set to 200ms

type Swamp

type Swamp struct {
	Network     mocknet.Mocknet
	CoreClient  core.Client
	BridgeNodes []*node.Node
	LightNodes  []*node.Node
	// contains filtered or unexported fields
}

Swamp represents the main functionality that is needed for the test-case: - Network to link the nodes - CoreClient to share between Bridge nodes - Slices of created Bridge/Light Nodes - trustedHash taken from the CoreClient and shared between nodes

func NewSwamp

func NewSwamp(t *testing.T, ic *Components) *Swamp

NewSwamp creates a new instance of Swamp.

func (*Swamp) NewBridgeNode

func (s *Swamp) NewBridgeNode(options ...node.Option) *node.Node

NewBridgeNode creates a new instance of a BridgeNode providing a default config and a mockstore to the NewBridgeNodeWithStore method

func (*Swamp) NewBridgeNodeWithStore

func (s *Swamp) NewBridgeNodeWithStore(store node.Store, options ...node.Option) *node.Node

NewBridgeNodeWithStore creates a new instance of BridgeNodes with predefined Store. Afterwards, the instance is stored in the swamp's BridgeNodes slice.

func (*Swamp) NewLightNode

func (s *Swamp) NewLightNode(options ...node.Option) *node.Node

NewLightNode creates a new instance of a LightNode providing a default config and a mockstore to the NewLightNodeWithStore method

func (*Swamp) NewLightNodeWithStore

func (s *Swamp) NewLightNodeWithStore(store node.Store, options ...node.Option) *node.Node

NewLightNodeWithStore creates a new instance of LightNode with predefined Store. Afterwards, the instance is stored in the swamp's LightNodes slice

func (*Swamp) WaitTillHeight

func (s *Swamp) WaitTillHeight(ctx context.Context, height int64)

WaitTillHeight holds the test execution until the given amount of blocks have been produced by the CoreClient.

Jump to

Keyboard shortcuts

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