testutils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultInitialBillID = money.NewBillID(nil, []byte{1})
	FCRID                = money.NewFeeCreditRecordID(nil, []byte{1})
)

Functions

func AddFeeCredit

func AddFeeCredit(t *testing.T, amount uint64, systemID types.SystemID, accountKey *account.AccountKey, unitID, unitBacklink []byte, fcrID, fcrBacklink []byte, node *testpartition.NodePartition)

func CreateMoneyPartition

func CreateMoneyPartition(t *testing.T, genesisConfig *testutil.MoneyGenesisConfig, nodeCount uint8) *testpartition.NodePartition

func CreateNewTestWallet

func CreateNewTestWallet(t *testing.T) string

func CreateNewTokenWallet

func CreateNewTokenWallet(t *testing.T, addr string) (*tokenswallet.Wallet, string)

func CreateNewWallet

func CreateNewWallet(t *testing.T) (account.Manager, string)

func CreateTokensPartition

func CreateTokensPartition(t *testing.T) *testpartition.NodePartition

func SetupTestHomeDir

func SetupTestHomeDir(t *testing.T, dir string) string

func SpendInitialBillWithFeeCredits

func SpendInitialBillWithFeeCredits(t *testing.T, abNet *testpartition.AlphabillNetwork, initialBillValue uint64, pk []byte) uint64

func StartAlphabill

func StartAlphabill(t *testing.T, partitions []*testpartition.NodePartition) *testpartition.AlphabillNetwork

func StartMoneyBackend

func StartMoneyBackend(t *testing.T, moneyPart *testpartition.NodePartition, genesisConfig *testutil.MoneyGenesisConfig) (string, *moneyclient.MoneyBackendClient)

func StartPartitionRPCServers

func StartPartitionRPCServers(t *testing.T, partition *testpartition.NodePartition)

func StartTokensBackend

func StartTokensBackend(t *testing.T, nodeAddr string) (srvUri string, restApi *tokenclient.TokenBackend)

func VerifyStdout

func VerifyStdout(t *testing.T, consoleWriter *TestConsoleWriter, expectedLines ...string)

func VerifyStdoutEventually

func VerifyStdoutEventually(t *testing.T, exec func() *TestConsoleWriter, expectedLines ...string)

func VerifyStdoutEventuallyWithTimeout

func VerifyStdoutEventuallyWithTimeout(t *testing.T, exec func() *TestConsoleWriter, waitFor time.Duration, tick time.Duration, expectedLines ...string)

func VerifyStdoutNotExists

func VerifyStdoutNotExists(t *testing.T, consoleWriter *TestConsoleWriter, expectedLines ...string)

Types

type TestConsoleWriter

type TestConsoleWriter struct {
	Lines []string
}

func (*TestConsoleWriter) Print

func (w *TestConsoleWriter) Print(a ...any)

func (*TestConsoleWriter) Println

func (w *TestConsoleWriter) Println(a ...any)

func (*TestConsoleWriter) String

func (w *TestConsoleWriter) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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