ocr2vrf_actions

package
v0.0.0-...-4e62b15 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOCR2DKGConfigVars

func BuildOCR2DKGConfigVars(
	t *testing.T,
	ocr2VRFPluginConfig *OCR2VRFPluginConfig,
) contracts.OCRv2Config

func BuildOCR2VRFConfigVars

func BuildOCR2VRFConfigVars(
	t *testing.T,
	ocr2VRFPluginConfig *OCR2VRFPluginConfig,
) contracts.OCRv2Config

func CreateOCR2VRFJobs

func CreateOCR2VRFJobs(
	t *testing.T,
	bootstrapNode *client.ChainlinkK8sClient,
	nonBootstrapNodes []*client.ChainlinkK8sClient,
	OCR2VRFPluginConfig *OCR2VRFPluginConfig,
	chainID int64,
	keyIndex int,
)

CreateOCR2VRFJobs bootstraps the first node and to the other nodes sends ocr jobs

func DecodeHexTo32ByteArray

func DecodeHexTo32ByteArray(val string) ([32]byte, error)

func DeployOCR2VRFContracts

func DeployOCR2VRFContracts(t *testing.T, contractDeployer contracts.ContractDeployer, chainClient blockchain.EVMClient, linkToken contracts.LinkToken, beaconPeriodBlocksCount *big.Int, keyID string) (contracts.DKG, contracts.VRFCoordinatorV3, contracts.VRFBeacon, contracts.VRFBeaconConsumer)

func FundVRFCoordinatorV3Subscription

func FundVRFCoordinatorV3Subscription(t *testing.T, linkToken contracts.LinkToken, coordinator contracts.VRFCoordinatorV3, chainClient blockchain.EVMClient, subscriptionID, linkFundingAmount *big.Int)

func RequestAndRedeemRandomness

func RequestAndRedeemRandomness(
	t *testing.T,
	consumer contracts.VRFBeaconConsumer,
	chainClient blockchain.EVMClient,
	vrfBeacon contracts.VRFBeacon,
	numberOfRandomWordsToRequest uint16,
	subscriptionID,
	confirmationDelay *big.Int,
	randomnessTransmissionEventTimeout time.Duration,
) *big.Int

func RequestRandomnessFulfillmentAndWaitForFulfilment

func RequestRandomnessFulfillmentAndWaitForFulfilment(
	t *testing.T,
	consumer contracts.VRFBeaconConsumer,
	chainClient blockchain.EVMClient,
	vrfBeacon contracts.VRFBeacon,
	numberOfRandomWordsToRequest uint16,
	subscriptionID *big.Int,
	confirmationDelay *big.Int,
	randomnessTransmissionEventTimeout time.Duration,
) *big.Int

func SetAndWaitForDKGProcessToFinish

func SetAndWaitForDKGProcessToFinish(t *testing.T, ocr2VRFPluginConfig *OCR2VRFPluginConfig, dkg contracts.DKG)

func SetAndWaitForVRFBeaconProcessToFinish

func SetAndWaitForVRFBeaconProcessToFinish(t *testing.T, ocr2VRFPluginConfig *OCR2VRFPluginConfig, vrfBeacon contracts.VRFBeacon)

func SetupOCR2VRFUniverse

func SetupOCR2VRFUniverse(
	t *testing.T,
	linkToken contracts.LinkToken,
	mockETHLinkFeed contracts.MockETHLINKFeed,
	contractDeployer contracts.ContractDeployer,
	chainClient blockchain.EVMClient,
	nodeAddresses []common.Address,
	chainlinkNodes []*client.ChainlinkK8sClient,
	testNetwork blockchain.EVMNetwork,
) (contracts.DKG, contracts.VRFCoordinatorV3, contracts.VRFBeacon, contracts.VRFBeaconConsumer, *big.Int)

Types

type DKGConfig

type DKGConfig struct {
	DKGKeyConfigs      []DKGKeyConfig
	DKGKeyID           string
	DKGContractAddress string
}

type DKGKeyConfig

type DKGKeyConfig struct {
	DKGEncryptionPublicKey string
	DKGSigningPublicKey    string
}

type OCR2Config

type OCR2Config struct {
	OnchainPublicKeys    []string
	OffchainPublicKeys   []string
	PeerIds              []string
	ConfigPublicKeys     []string
	TransmitterAddresses []string
	Schedule             []int
}

type OCR2VRFPluginConfig

type OCR2VRFPluginConfig struct {
	OCR2Config            OCR2Config
	DKGConfig             DKGConfig
	VRFBeaconConfig       VRFBeaconConfig
	VRFCoordinatorAddress string
	LinkEthFeedAddress    string
}

func SetAndGetOCR2VRFPluginConfig

func SetAndGetOCR2VRFPluginConfig(
	t *testing.T,
	nonBootstrapNodes []*client.ChainlinkK8sClient,
	dkg contracts.DKG,
	vrfBeacon contracts.VRFBeacon,
	coordinator contracts.VRFCoordinatorV3,
	mockETHLinkFeed contracts.MockETHLINKFeed,
	keyID string,
	vrfBeaconAllowedConfirmationDelays []string,
	coordinatorConfig *ocr2vrftypes.CoordinatorConfig,
) *OCR2VRFPluginConfig

type VRFBeaconConfig

type VRFBeaconConfig struct {
	VRFBeaconAddress  string
	ConfDelays        []string
	CoordinatorConfig *ocr2vrftypes.CoordinatorConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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