common

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfirmContractDeployed added in v1.6.0

func ConfirmContractDeployed(context context.Context, client *ethclient.Client, transaction *types.Transaction, chainID int64) (address common.Address)

ConfirmContractDeployed confirms that the given contract deployment transaction completed and prints useful execution information.

func ConfirmTXMined added in v1.6.0

func ConfirmTXMined(context context.Context, client *ethclient.Client, transaction *types.Transaction, chainID int64, txInfo ...string) (receipt *types.Receipt)

ConfirmTXMined confirms that the given transaction is mined and prints useful execution information.

func DeployLinkEthFeed added in v1.7.0

func DeployLinkEthFeed(e Environment, linkAddress string, weiPerUnitLink *big.Int) common.Address

func DeployLinkToken added in v1.7.0

func DeployLinkToken(e Environment) common.Address
func ExplorerLink(chainID int64, txHash common.Hash) string

ExplorerLink creates a block explorer link for the given transaction hash. If the chain ID is unrecognized, the hash is returned as-is.

func FundNodes added in v1.7.0

func FundNodes(e Environment, transmitters []string, fundingAmount *big.Int)

func IsAvaxNetwork added in v1.8.0

func IsAvaxNetwork(chainID int64) bool

IsAvaxNetwork returns true if the given chain ID corresponds to an avalanche network or subnet.

func PanicErr

func PanicErr(err error)

PanicErr panics if error the given error is non-nil.

func ParseAddressSlice added in v1.6.0

func ParseAddressSlice(arg string) (ret []common.Address)

ParseAddressSlice parses the given comma-separated string of addresses into a slice of common.Address objects.

func ParseArgs

func ParseArgs(flagSet *flag.FlagSet, args []string, requiredArgs ...string)

ParseArgs parses arguments and ensures required args are set.

func ParseBigIntSlice added in v1.6.0

func ParseBigIntSlice(arg string) (ret []*big.Int)

ParseBigIntSlice parses the given comma-separated string of integers into a slice of *big.Int objects.

func ParseHashSlice added in v1.6.0

func ParseHashSlice(arg string) (ret []common.Hash)

ParseHashSlice parses the given comma-separated string of hashes into a slice of common.Hash objects.

func ParseIntSlice added in v1.6.0

func ParseIntSlice(arg string) (ret []int)

ParseIntSlice parses the given comma-separated string of integers into a slice of int.

Types

type Environment added in v1.6.0

type Environment struct {
	Owner *bind.TransactOpts
	Ec    *ethclient.Client

	// AvaxEc is appropriately set if the environment is configured to interact with an avalanche
	// chain. It should be used instead of the regular Ec field because avalanche calculates
	// blockhashes differently and the regular Ec will give consistently incorrect results on basic
	// queries (like e.g eth_blockByNumber).
	AvaxEc  avaxclient.Client
	ChainID int64
}

func SetupEnv added in v1.6.0

func SetupEnv(overrideNonce bool) Environment

SetupEnv returns an Environment object populated from environment variables. If overrideNonce is set to true, the nonce will be set to what is returned by NonceAt (rather than the typical PendingNonceAt).

Jump to

Keyboard shortcuts

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