utils

package
v1.18.7 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 16 Imported by: 1

Documentation

Overview

Package utils contains some common paths used in configuration and tests

Index

Constants

This section is empty.

Variables

View Source
var (

	// ProjectRoot Root folder of this project
	ProjectRoot = filepath.Join(filepath.Dir(b), "/..")
	// ChartsRoot test suite root
	ChartsRoot = filepath.Join(ProjectRoot, "charts")
	// K8sRoot test suite soak root
	K8sRoot = filepath.Join(ProjectRoot, "soak")
	// PresetRoot root folder for environments preset
	PresetRoot = filepath.Join(ProjectRoot, "preset")
	// ContractsDir path to our contracts
	ContractsDir = filepath.Join(ProjectRoot, "contracts")
	// EthereumContractsDir path to our ethereum contracts
	EthereumContractsDir = filepath.Join(ContractsDir, "ethereum")
	// MirrorDir path to our ecr mirror helpers
	MirrorDir = filepath.Join(ProjectRoot, "mirror")
)

Functions

func EtherToWei

func EtherToWei(eth *big.Float) *big.Int

EtherToWei converts an ETH float amount to wei

func ExecCmd added in v1.18.5

func ExecCmd(l zerolog.Logger, command string) error

ExecCmd executes a command and logs the output

func ExecCmdWithContext added in v1.18.5

func ExecCmdWithContext(ctx context.Context, l zerolog.Logger, command string) error

ExecCmdWithContext executes a command with ctx and logs the output

func ExecCmdWithOptions added in v1.18.5

func ExecCmdWithOptions(ctx context.Context, l zerolog.Logger, command string, outputFunction func(string)) error

ExecCmdWithOptions executes a command with ctx and logs the output with a custom logging func

func GetEnv added in v1.10.9

func GetEnv(key string) (string, error)

GetEnv returns the value of the environment variable named by the key and sets the environment variable up to be used in the remote runner

func PrivateKeyToAddress

func PrivateKeyToAddress(privateKey *ecdsa.PrivateKey) (common.Address, error)

PrivateKeyToAddress is a handy converter for an ecdsa private key to a usable eth address

func Ptr added in v1.18.4

func Ptr[T any](value T) *T

func SetupEnvVarsForRemoteRunner added in v1.11.1

func SetupEnvVarsForRemoteRunner(envVars []string) error

SetupEnvVarsForRemoteRunner sets up the environment variables in the list to propagate to the remote runner

func WeiToEther

func WeiToEther(wei *big.Int) *big.Float

WeiToEther converts a wei amount to eth float

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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