localnet

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerizedNode

type ContainerizedNode interface {
	Start() error
	Stop() error
	Reset() error
	Remove() error
	GetHTTPEndpoint() string
	GetWSEndpoint() string
	EthClient() *ethclient.Client
	EthWsClient() *ethclient.Client
	WaitForBlock(number uint64) error
	WaitForNextBlock() error
	DumpLogs() (string, error)
}

ContainerizedNode is an interface for a containerized network.

func NewContainerizedNode

func NewContainerizedNode(
	repository string,
	tag string,
	name string,
	httpAddress string,
	wsAddress string,
	env []string,
) (c ContainerizedNode, err error)

NewContainerizedNode creates an implementation of Localnet using Docker.

type FixtureConfig

type FixtureConfig struct {
	// contains filtered or unexported fields
}

FixtureConfig is a type defining the configuration of a TestFixture.

func NewFixtureConfig

func NewFixtureConfig(
	configRelativePath,
	baseImage,
	localnetImage,
	containerName,
	httpAddress,
	wsAdddress,
	goVersion string,
) *FixtureConfig

NewFixtureConfig creates a new FixtureConfig and infers the config directory absolute path from given relative path. requires: the configRelativePath to be relative to the file calling NewFixtureConfig.

type TestFixture

type TestFixture struct {
	ContainerizedNode
	// contains filtered or unexported fields
}

TestFixture is a testing fixture that runs a single Polaris validator node in a Docker container.

func NewTestFixture

func NewTestFixture(t ginkgo.FullGinkgoTInterface, config *FixtureConfig) *TestFixture

NewTestFixture creates a new TestFixture.

func (*TestFixture) Address

func (tf *TestFixture) Address(name string) common.Address

func (*TestFixture) GenerateTransactOpts

func (tf *TestFixture) GenerateTransactOpts(name string) *bind.TransactOpts

GenerateTransactOpts generates a new transaction options object for a key by it's name.

func (*TestFixture) PrivKey

func (tf *TestFixture) PrivKey(name string) *ecdsa.PrivateKey

func (*TestFixture) Teardown

func (tf *TestFixture) Teardown() error

func (*TestFixture) ValAddr

func (tf *TestFixture) ValAddr() common.Address

Jump to

Keyboard shortcuts

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