Documentation ¶
Overview ¶
Package actions enables common chainlink interactions
Index ¶
- Constants
- Variables
- func BuildGoTests(executablePath, testsPath, projectRootPath string) (string, int64, error)
- func BuildNodeContractPairID(node client.Chainlink, ocrInstance contracts.OffchainAggregator) string
- func ChainlinkNodeAddresses(nodes []client.Chainlink) ([]common.Address, error)
- func CreateKeeperJobs(chainlinkNodes []client.Chainlink, keeperRegistry contracts.KeeperRegistry)
- func CreateOCRJobs(ocrInstances []contracts.OffchainAggregator, chainlinkNodes []client.Chainlink, ...) func()
- func DeployKeeperConsumers(contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, ...) []contracts.KeeperConsumer
- func DeployKeeperConsumersPerformance(contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, ...) []contracts.KeeperConsumerPerformance
- func DeployKeeperContracts(registryVersion ethereum.KeeperRegistryVersion, ...) (contracts.KeeperRegistry, contracts.KeeperRegistrar, ...)
- func DeployKeeperRegistrar(linkToken contracts.LinkToken, ...) contracts.KeeperRegistrar
- func DeployKeeperRegistry(contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, ...) contracts.KeeperRegistry
- func DeployOCRContracts(numberOfContracts int, linkTokenContract contracts.LinkToken, ...) []contracts.OffchainAggregator
- func DeployPerformanceKeeperContracts(registryVersion ethereum.KeeperRegistryVersion, numberOfContracts int, ...) (contracts.KeeperRegistry, contracts.KeeperRegistrar, ...)
- func DeployUpkeepCounters(contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, ...) []contracts.UpkeepCounter
- func DeployUpkeepPerformCounterRestrictive(contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, ...) []contracts.UpkeepPerformCounterRestrictive
- func DeployUpkeepTranscoder(contractDeployer contracts.ContractDeployer, client blockchain.EVMClient) contracts.UpkeepTranscoder
- func DeployVRFV2Contracts(linkTokenContract contracts.LinkToken, ...) (contracts.VRFCoordinatorV2, contracts.VRFConsumerV2, contracts.BlockHashStore)
- func EncodeOnChainExternalJobID(jobID uuid.UUID) [32]byte
- func EncodeOnChainVRFProvingKey(vrfKey client.VRFKey) ([2]*big.Int, error)
- func ExtractRequestIDFromJobRun(jobDecodeData client.RunsResponseData) ([]byte, error)
- func FundAddresses(blockchain blockchain.EVMClient, amount *big.Float, addresses ...string) error
- func FundChainlinkNodes(nodes []client.Chainlink, client blockchain.EVMClient, amount *big.Float) error
- func FundChainlinkNodesLink(nodes []client.Chainlink, blockchain blockchain.EVMClient, ...) error
- func GetMockserverInitializerDataForOTPE(OCRInstances []contracts.OffchainAggregator, chainlinkNodes []client.Chainlink) (interface{}, error)
- func GinkgoSuite()
- func RegisterNewUpkeeps(contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, ...) ([]contracts.KeeperConsumer, []*big.Int)
- func RegisterUpkeepContracts(linkToken contracts.LinkToken, linkFunds *big.Int, client blockchain.EVMClient, ...) []*big.Int
- func SetAdapterResponse(response int, ocrInstance contracts.OffchainAggregator, ...) func()
- func SetAllAdapterResponsesToDifferentValues(responses []int, ocrInstances []contracts.OffchainAggregator, ...) func()
- func SetAllAdapterResponsesToTheSameValue(response int, ocrInstances []contracts.OffchainAggregator, ...) func()
- func SetChainlinkAPIPageSize(nodes []client.Chainlink, pageSize int)
- func StartNewRound(roundNr int64, ocrInstances []contracts.OffchainAggregator, ...) func()
- func TeardownRemoteSuite(env *environment.Environment, chainlinkNodes []client.Chainlink, ...) error
- func TeardownSuite(env *environment.Environment, logsFolderPath string, ...) error
- func TriggerRemoteTest(exePath string, testEnvironment *environment.Environment) error
- type VRFV2EncodedProvingKey
- type VRFV2JobInfo
Constants ¶
const ( // DefaultArtifactsDir default artifacts dir DefaultArtifactsDir string = "logs" )
Variables ¶
var ContractDeploymentInterval = 200
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
var ZeroAddress = common.Address{}
Functions ¶
func BuildGoTests ¶ added in v1.2.3
BuildGoTests builds the go tests using native go cross-compilation to run, and returns a path to the test executable along with its size in bytes.
Note: currentProjectRootPath and currentSoakTestRootPath are not interchangeable with utils.ProjectRoot and utils.SoakRoot when running in outside repositories. Keep an eye on when you need paths leading to this go package vs the current running project.
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 ¶
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, client blockchain.EVMClient, numberOfContracts int, ) []contracts.KeeperConsumer
func DeployKeeperConsumersPerformance ¶ added in v1.1.20
func DeployKeeperConsumersPerformance( contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, numberOfContracts int, blockRange, blockInterval, checkGasToBurn, performGasToBurn int64, ) []contracts.KeeperConsumerPerformance
func DeployKeeperContracts ¶
func DeployKeeperContracts( registryVersion ethereum.KeeperRegistryVersion, registrySettings contracts.KeeperRegistrySettings, numberOfUpkeeps int, upkeepGasLimit uint32, linkToken contracts.LinkToken, contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, linkFundsForEachUpkeep *big.Int, ) (contracts.KeeperRegistry, contracts.KeeperRegistrar, []contracts.KeeperConsumer, []*big.Int)
DeployKeeperContracts deploys keeper registry and a number of basic upkeep contracts with an update interval of 5. It returns the freshly deployed registry, registrar, consumers and the IDs of the upkeeps.
func DeployKeeperRegistrar ¶ added in v1.1.20
func DeployKeeperRegistrar( linkToken contracts.LinkToken, registrarSettings contracts.KeeperRegistrarSettings, contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, registry contracts.KeeperRegistry, ) contracts.KeeperRegistrar
func DeployKeeperRegistry ¶ added in v1.1.20
func DeployKeeperRegistry( contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, registryOpts *contracts.KeeperRegistryOpts, ) contracts.KeeperRegistry
func DeployOCRContracts ¶
func DeployOCRContracts( numberOfContracts int, linkTokenContract contracts.LinkToken, contractDeployer contracts.ContractDeployer, chainlinkNodes []client.Chainlink, client blockchain.EVMClient, ) []contracts.OffchainAggregator
DeployOCRContracts deploys and funds a certain number of offchain aggregator contracts
func DeployPerformanceKeeperContracts ¶
func DeployPerformanceKeeperContracts( registryVersion ethereum.KeeperRegistryVersion, numberOfContracts int, upkeepGasLimit uint32, linkToken contracts.LinkToken, contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, registrySettings *contracts.KeeperRegistrySettings, linkFundsForEachUpkeep *big.Int, blockRange, blockInterval, checkGasToBurn, performGasToBurn int64, ) (contracts.KeeperRegistry, contracts.KeeperRegistrar, []contracts.KeeperConsumerPerformance, []*big.Int)
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, client blockchain.EVMClient, numberOfContracts int, testRange *big.Int, interval *big.Int, ) []contracts.UpkeepCounter
func DeployUpkeepPerformCounterRestrictive ¶ added in v1.1.20
func DeployUpkeepPerformCounterRestrictive( contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, numberOfContracts int, testRange *big.Int, averageEligibilityCadence *big.Int, ) []contracts.UpkeepPerformCounterRestrictive
func DeployUpkeepTranscoder ¶ added in v1.4.5
func DeployUpkeepTranscoder(contractDeployer contracts.ContractDeployer, client blockchain.EVMClient) contracts.UpkeepTranscoder
func DeployVRFV2Contracts ¶ added in v1.2.4
func DeployVRFV2Contracts( linkTokenContract contracts.LinkToken, contractDeployer contracts.ContractDeployer, c blockchain.EVMClient, linkEthFeedAddress string, ) (contracts.VRFCoordinatorV2, contracts.VRFConsumerV2, contracts.BlockHashStore)
func EncodeOnChainExternalJobID ¶
EncodeOnChainExternalJobID encodes external job uuid to on-chain representation
func EncodeOnChainVRFProvingKey ¶
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 ¶
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 ¶
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 RegisterNewUpkeeps ¶ added in v1.2.6
func RegisterNewUpkeeps( contractDeployer contracts.ContractDeployer, client blockchain.EVMClient, linkToken contracts.LinkToken, registry contracts.KeeperRegistry, registrar contracts.KeeperRegistrar, upkeepGasLimit uint32, numberOfNewUpkeeps int, ) ([]contracts.KeeperConsumer, []*big.Int)
RegisterNewUpkeeps registers the given amount of new upkeeps, using the registry and registrar which are passed as parameters. It returns the newly deployed contracts (consumers), as well as their upkeep IDs.
func RegisterUpkeepContracts ¶ added in v1.1.20
func RegisterUpkeepContracts( linkToken contracts.LinkToken, linkFunds *big.Int, client blockchain.EVMClient, upkeepGasLimit uint32, registry contracts.KeeperRegistry, registrar contracts.KeeperRegistrar, numberOfContracts int, upkeepAddresses []string, ) []*big.Int
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 ¶
SetChainlinkAPIPageSize specifies the page size from the Chainlink API, useful for high volume testing
func StartNewRound ¶
func StartNewRound( roundNr int64, ocrInstances []contracts.OffchainAggregator, client blockchain.EVMClient, ) func()
StartNewRound requests a new round from the ocr contracts and waits for confirmation
func TeardownRemoteSuite ¶
func TeardownRemoteSuite( env *environment.Environment, chainlinkNodes []client.Chainlink, optionalTestReporter testreporters.TestReporter, client blockchain.EVMClient, ) 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, logsFolderPath string, chainlinkNodes []client.Chainlink, optionalTestReporter testreporters.TestReporter, c blockchain.EVMClient, ) 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
func TriggerRemoteTest ¶ added in v1.4.0
func TriggerRemoteTest(exePath string, testEnvironment *environment.Environment) error
TriggerRemoteTest copies the executable to the remote-test-runner and starts the run
Types ¶
type VRFV2EncodedProvingKey ¶ added in v1.2.4
func VRFV2RegisterProvingKey ¶ added in v1.2.4
func VRFV2RegisterProvingKey( vrfKey *client.VRFKey, oracleAddress string, coordinator contracts.VRFCoordinatorV2, ) VRFV2EncodedProvingKey
type VRFV2JobInfo ¶ added in v1.2.6
type VRFV2JobInfo struct { Job *client.Job VRFKey *client.VRFKey ProvingKey VRFV2EncodedProvingKey ProvingKeyHash [32]byte }
VRFV2JobInfo defines a jobs into and proving key info
func CreateVRFV2Jobs ¶ added in v1.2.4
func CreateVRFV2Jobs( chainlinkNodes []client.Chainlink, coordinator contracts.VRFCoordinatorV2, c blockchain.EVMClient, minIncomingConfirmations int, ) []VRFV2JobInfo