testutils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCustomTestRemoteDcrwallet

func NewCustomTestRemoteDcrwallet(t TB, nodeName, dataDir string,
	hdSeed, privatePass []byte,
	dcrd *rpcclient.ConnConfig, spv *SPVConfig) (*grpc.ClientConn, func())

NewCustomTestRemoteDcrwallet runs a dcrwallet instance for use during tests.

func NewSetupRPCTest

func NewSetupRPCTest(t *testing.T, maxTries int, netParams *chaincfg.Params,
	handlers *rpcclient.NotificationHandlers,
	args []string, setupChain bool, numMatureOutputs uint32) (*rpctest.Harness, error)

NewSetupRPCTest attempts up to maxTries to setup an rpctest harness or errors. This is used to get around the fact the rpctest does not validate listening addresses beforehand and might try to listen on an used address in CI servers.

The returned rpctest is already setup for use.

func NewSyncingTestWallet

func NewSyncingTestWallet(t TB, rpcConfig *rpcclient.ConnConfig) (*wallet.Wallet, func())

func NewTestRemoteDcrwallet

func NewTestRemoteDcrwallet(t TB, dcrd *rpcclient.ConnConfig) (*grpc.ClientConn, func())

NewTestRemoteDcrwallet creates a new dcrwallet process that can be used by a remotedcrwallet instance to perform the interface tests. This currently only supports running the wallet in rpc sync mode.

This function returns the grpc conn and a cleanup function to close the wallet.

func SetPerAccountPassphrase added in v0.3.3

func SetPerAccountPassphrase(conn *grpc.ClientConn, passphrase []byte) error

SetPerAccountPassphrase calls the SetAccountPassphrase rpc endpoint on the wallet at the given conn, setting it to the specified passphrse.

This function expects a conn returned by NewTestRemoteDcrwallet.

Types

type SPVConfig added in v0.3.4

type SPVConfig struct {
	Address string
}

type TB

type TB interface {
	Fatal(...interface{})
	Fatalf(string, ...interface{})
	Errorf(string, ...interface{})
	Failed() bool
	Helper()
	Logf(string, ...interface{})
}

TB is an interface that fulfills both testing.T and testing.B for their common methods.

Jump to

Keyboard shortcuts

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