utils

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: GPL-3.0, LGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DYNAMIC_RPC_FILE = "contract-examples/dynamic_rpc.json"
	LOCAL_RPC_FILE   = "contract-examples/local_rpc.json"
)

Variables

This section is empty.

Functions

func DescribeLocal

func DescribeLocal(text string, body func()) bool

DescribeLocal annotates the tests that requires local network-runner. Can only run with local cluster.

func DescribePrecompile

func DescribePrecompile(body func()) bool

func GetClient added in v0.4.4

func GetClient() runner_sdk.Client

func GetExecPath added in v0.4.0

func GetExecPath() string

Loads the executable path for "avalanchego".

func GetOutputPath

func GetOutputPath() string

func GetPluginDir

func GetPluginDir() string

func GetSkipNetworkRunnerShutdown added in v0.4.0

func GetSkipNetworkRunnerShutdown() bool

func GetVmGenesisPath added in v0.4.0

func GetVmGenesisPath() string

func Outf added in v0.4.4

func Outf(format string, args ...interface{})

Outputs to stdout.

e.g.,

Outf("{{green}}{{bold}}hi there %q{{/}}", "aa")
Outf("{{magenta}}{{bold}}hi therea{{/}} {{cyan}}{{underline}}b{{/}}")

ref. https://github.com/onsi/ginkgo/blob/v2.0.0/formatter/formatter.go#L52-L73

func RunCommand added in v0.4.4

func RunCommand(ctx context.Context, bin string, args ...string) (cmd.Status, error)

func SetClient added in v0.4.4

func SetClient(c runner_sdk.Client)

func SetClusterInfo added in v0.4.4

func SetClusterInfo(c ClusterInfo)

func SetExecPath added in v0.4.0

func SetExecPath(p string)

Sets the executable path for "avalanchego".

func SetOutputFile

func SetOutputFile(filepath string)

func SetPluginDir

func SetPluginDir(dir string)

func SetSkipNetworkRunnerShutdown added in v0.4.0

func SetSkipNetworkRunnerShutdown(b bool)

func SetVmGenesisPath added in v0.4.0

func SetVmGenesisPath(p string)

func UpdateHardhatConfig

func UpdateHardhatConfig() error

Types

type ClusterInfo added in v0.4.4

type ClusterInfo struct {
	URIs                  []string `json:"uris"`
	Endpoint              string   `json:"endpoint"`
	PID                   int      `json:"pid"`
	LogsDir               string   `json:"logsDir"`
	SubnetEVMRPCEndpoints []string `json:"subnetEVMRPCEndpoints"`
}

ClusterInfo represents the local cluster information.

func GetClusterInfo added in v0.4.4

func GetClusterInfo() ClusterInfo

func (ClusterInfo) Save added in v0.4.4

func (ci ClusterInfo) Save(p string) error

type EvmClient added in v0.4.4

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

func NewEvmClient added in v0.4.4

func NewEvmClient(ep string, baseFee uint64, priorityFee uint64) (*EvmClient, error)

func (*EvmClient) ConfirmTx added in v0.4.4

func (ec *EvmClient) ConfirmTx(ctx context.Context, txHash common.Hash) (*big.Int, error)

func (*EvmClient) FetchBalance added in v0.4.4

func (ec *EvmClient) FetchBalance(ctx context.Context, addr common.Address) (*big.Int, error)

func (*EvmClient) FetchNonce added in v0.4.4

func (ec *EvmClient) FetchNonce(ctx context.Context, addr common.Address) (uint64, error)

func (*EvmClient) TransferTx added in v0.4.4

func (ec *EvmClient) TransferTx(
	ctx context.Context,
	sender common.Address,
	senderPriv *ecdsa.PrivateKey,
	recipient common.Address,
	transferAmount *big.Int) (*big.Int, error)

makes transfer tx and returns the new balance of sender

func (*EvmClient) WaitForBalance added in v0.4.4

func (ec *EvmClient) WaitForBalance(ctx context.Context, addr common.Address, minBalance *big.Int) error

Jump to

Keyboard shortcuts

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