actions

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package actions enables common chainlink interactions

Index

Constants

View Source
const (
	// DefaultArtifactsDir default artifacts dir
	DefaultArtifactsDir string = "logs"
)

Variables

View Source
var ContractDeploymentInterval = 500

ContractDeploymentInterval After how many contract actions to wait before starting any more Example: When deploying 1000 contracts, stop every ContractDeploymentInterval have been deployed to wait before continuing

Functions

func BuildNodeContractPairID

func BuildNodeContractPairID(node client.Chainlink, ocrInstance contracts.OffchainAggregator) string

BuildNodeContractPairID builds a UUID based on a related pair of a Chainlink node and OCR contract

func ChainlinkNodeAddresses

func ChainlinkNodeAddresses(nodes []client.Chainlink) ([]common.Address, error)

ChainlinkNodeAddresses will return all the on-chain wallet addresses for a set of Chainlink nodes

func CreateKeeperJobs

func CreateKeeperJobs(chainlinkNodes []client.Chainlink, keeperRegistry contracts.KeeperRegistry)

func CreateOCRJobs

func CreateOCRJobs(
	ocrInstances []contracts.OffchainAggregator,
	chainlinkNodes []client.Chainlink,
	mockserver *client.MockserverClient,
) func()

CreateOCRJobs bootstraps the first node and to the other nodes sends ocr jobs that read from different adapters, to be used in combination with SetAdapterResponses

func DeployKeeperConsumers added in v1.1.20

func DeployKeeperConsumers(
	contractDeployer contracts.ContractDeployer,
	networks *blockchain.Networks,
	numberOfContracts int,
) []contracts.KeeperConsumer

func DeployKeeperConsumersPerformance added in v1.1.20

func DeployKeeperConsumersPerformance(
	contractDeployer contracts.ContractDeployer,
	networks *blockchain.Networks,
	numberOfContracts int,
	blockRange,
	blockInterval,
	checkGasToBurn,
	performGasToBurn int64,
) []contracts.KeeperConsumerPerformance

func DeployKeeperContracts

func DeployKeeperContracts(
	numberOfContracts int,
	linkToken contracts.LinkToken,
	contractDeployer contracts.ContractDeployer,
	networks *blockchain.Networks,
) (contracts.KeeperRegistry, []contracts.KeeperConsumer)

DeployKeeperContracts deploys a number of basic keeper contracts with an update interval of 5

func DeployKeeperRegistrar added in v1.1.20

func DeployKeeperRegistrar(
	linkToken contracts.LinkToken,
	registrarSettings contracts.KeeperRegistrarSettings,
	contractDeployer contracts.ContractDeployer,
	networks *blockchain.Networks,
	registry contracts.KeeperRegistry,
) contracts.UpkeepRegistrar

func DeployKeeperRegistry added in v1.1.20

func DeployKeeperRegistry(
	registrySettings *contracts.KeeperRegistrySettings,
	linkToken contracts.LinkToken,
	contractDeployer contracts.ContractDeployer,
	networks *blockchain.Networks,
	mockLinkEthFeed contracts.MockETHLINKFeed,
	mockGasFeed contracts.MockGasFeed,
) contracts.KeeperRegistry

func DeployOCRContracts

func DeployOCRContracts(
	numberOfContracts int,
	linkTokenContract contracts.LinkToken,
	contractDeployer contracts.ContractDeployer,
	chainlinkNodes []client.Chainlink,
	networks *blockchain.Networks,
) []contracts.OffchainAggregator

DeployOCRContracts deploys and funds a certain number of offchain aggregator contracts

func DeployPerformanceKeeperContracts

func DeployPerformanceKeeperContracts(
	numberOfContracts int,
	linkToken contracts.LinkToken,
	contractDeployer contracts.ContractDeployer,
	networks *blockchain.Networks,
	registrySettings *contracts.KeeperRegistrySettings,
	blockRange,
	blockInterval,
	checkGasToBurn,
	performGasToBurn int64,
) (contracts.KeeperRegistry, []contracts.KeeperConsumerPerformance)

DeployPerformanceKeeperContracts deploys a set amount of keeper performance contracts registered to a single registry

func DeployUpkeepCounters added in v1.1.20

func DeployUpkeepCounters(
	contractDeployer contracts.ContractDeployer,
	networks *blockchain.Networks,
	numberOfContracts int,
	testRange *big.Int,
	interval *big.Int,
) []contracts.UpkeepCounter

func DeployUpkeepPerformCounterRestrictive added in v1.1.20

func DeployUpkeepPerformCounterRestrictive(
	contractDeployer contracts.ContractDeployer,
	networks *blockchain.Networks,
	numberOfContracts int,
	testRange *big.Int,
	averageEligibilityCadence *big.Int,
) []contracts.UpkeepPerformCounterRestrictive

func EncodeOnChainExternalJobID

func EncodeOnChainExternalJobID(jobID uuid.UUID) [32]byte

EncodeOnChainExternalJobID encodes external job uuid to on-chain representation

func EncodeOnChainVRFProvingKey

func EncodeOnChainVRFProvingKey(vrfKey client.VRFKey) ([2]*big.Int, error)

EncodeOnChainVRFProvingKey encodes uncompressed public VRF key to on-chain representation

func ExtractRequestIDFromJobRun

func ExtractRequestIDFromJobRun(jobDecodeData client.RunsResponseData) ([]byte, error)

ExtractRequestIDFromJobRun extracts RequestID from job runs response

func FundAddresses

func FundAddresses(blockchain blockchain.EVMClient, amount *big.Float, addresses ...string) error

FundAddresses will fund a list of addresses with an amount of native currency

func FundChainlinkNodes

func FundChainlinkNodes(
	nodes []client.Chainlink,
	client blockchain.EVMClient,
	amount *big.Float,
) error

FundChainlinkNodes will fund all of the provided Chainlink nodes with a set amount of native currency

func FundChainlinkNodesLink(
	nodes []client.Chainlink,
	blockchain blockchain.EVMClient,
	linkToken contracts.LinkToken,
	linkAmount *big.Int,
) error

FundChainlinkNodes will fund all of the provided Chainlink nodes with a set amount of native currency

func GetMockserverInitializerDataForOTPE

func GetMockserverInitializerDataForOTPE(
	OCRInstances []contracts.OffchainAggregator,
	chainlinkNodes []client.Chainlink,
) (interface{}, error)

GetMockserverInitializerDataForOTPE creates mocked weiwatchers data needed for otpe

func GinkgoSuite

func GinkgoSuite()

GinkgoSuite provides the default setup for running a Ginkgo test suite

func LoadConfigs

func LoadConfigs()

LoadConfigs load all config files, with overrides in order: 1. `default` tag fields on config.Config struct 2. Decode function calls on major config structs, see config.Config 3. `envconfig` tags on previously decoded major configs, see Decode functions in config package

func RegisterUpkeepContracts added in v1.1.20

func RegisterUpkeepContracts(
	linkToken contracts.LinkToken,
	linkFunds *big.Int,
	networks *blockchain.Networks,
	registrySettings *contracts.KeeperRegistrySettings,
	registrar contracts.UpkeepRegistrar,
	numberOfContracts int,
	upkeepAdresses []string,
)

func SetAdapterResponse

func SetAdapterResponse(
	response int,
	ocrInstance contracts.OffchainAggregator,
	chainlinkNode client.Chainlink,
	mockserver *client.MockserverClient,
) func()

SetAdapterResponse sets a single adapter response that correlates with an ocr contract and a chainlink node

func SetAllAdapterResponsesToDifferentValues

func SetAllAdapterResponsesToDifferentValues(
	responses []int,
	ocrInstances []contracts.OffchainAggregator,
	chainlinkNodes []client.Chainlink,
	mockserver *client.MockserverClient,
) func()

SetAllAdapterResponsesToDifferentValues sets the mock responses in mockserver that are read by chainlink nodes to simulate different adapters. This sets all adapter responses for each node and contract to different responses

func SetAllAdapterResponsesToTheSameValue

func SetAllAdapterResponsesToTheSameValue(
	response int,
	ocrInstances []contracts.OffchainAggregator,
	chainlinkNodes []client.Chainlink,
	mockserver *client.MockserverClient,
) func()

SetAllAdapterResponsesToTheSameValue sets the mock responses in mockserver that are read by chainlink nodes to simulate different adapters. This sets all adapter responses for each node and contract to the same response

func SetChainlinkAPIPageSize

func SetChainlinkAPIPageSize(nodes []client.Chainlink, pageSize int)

SetChainlinkAPIPageSize specifies the page size from the Chainlink API, useful for high volume testing

func StartNewRound

func StartNewRound(
	roundNr int64,
	ocrInstances []contracts.OffchainAggregator,
	networks *blockchain.Networks,
) func()

StartNewRound requests a new round from the ocr contracts and waits for confirmation

func TeardownRemoteSuite

func TeardownRemoteSuite(
	env *environment.Environment,
	nets *blockchain.Networks,
	chainlinkNodes []client.Chainlink,
	optionalTestReporter testreporters.TestReporter,
) error

TeardownRemoteSuite is used when running a test within a remote-test-runner, like for long-running performance and soak tests

func TeardownSuite

func TeardownSuite(
	env *environment.Environment,
	nets *blockchain.Networks,
	logsFolderPath string,
	chainlinkNodes []client.Chainlink,
	optionalTestReporter testreporters.TestReporter,
) error

TeardownSuite tears down networks/clients and environment and creates a logs folder for failed tests in the specified path. Can also accept a testreporter (if one was used) to log further results

Types

This section is empty.

Jump to

Keyboard shortcuts

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