testutils

package
v0.0.0-...-29137c7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestnetUrl = "https://api.testnet.aptoslabs.com/v1"
	DevnetUrl  = "https://api.devnet.aptoslabs.com/v1"
)

Variables

This section is empty.

Functions

func FindGitRoot

func FindGitRoot() (string, error)

Finds the closest git repo root, assuming that a directory with a .git directory is a git repo.

func FundWithFaucet

func FundWithFaucet(logger logger.Logger, client *aptos.NodeClient, address aptos.AccountAddress, faucetUrl string) error

func HasCounterResource

func HasCounterResource(client *aptos.NodeClient, counterAddress aptos.AccountAddress) bool

func LoadAccountFromEnv

func LoadAccountFromEnv(t *testing.T, logger logger.Logger) (ed25519.PrivateKey, ed25519.PublicKey, aptos.AccountAddress)

Loads an account, assuming no key rotation has taken place.

func ReadCounterValue

func ReadCounterValue(t *testing.T, client *aptos.NodeClient, counterAddress aptos.AccountAddress) uint64

func StartAptosNode

func StartAptosNode() error

Types

type CompilationResult

type CompilationResult struct {
	PackageMetadata []byte
	BytecodeModules [][]byte
}

func CompileMovePackage

func CompileMovePackage(
	t *testing.T,
	contractsDir string,
	namedAddresses map[string]aptos.AccountAddress,
	moduleOrder []string,
) CompilationResult

func CompileTestModule

func CompileTestModule(t *testing.T, moduleAddress aptos.AccountAddress) CompilationResult

type TestKeystore

type TestKeystore struct {
	Keys map[string]ed25519.PrivateKey
	// contains filtered or unexported fields
}

func NewTestKeystore

func NewTestKeystore(t *testing.T) *TestKeystore

func (*TestKeystore) Accounts

func (tk *TestKeystore) Accounts(ctx context.Context) ([]string, error)

func (*TestKeystore) AddKey

func (tk *TestKeystore) AddKey(privateKey ed25519.PrivateKey)

func (*TestKeystore) Sign

func (tk *TestKeystore) Sign(ctx context.Context, id string, hash []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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