Skip to content

Commit

Permalink
Merge branch 'develop' into chore/2.0.0-merge-release
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Apr 26, 2023
2 parents 69b07aa + fcf7471 commit ad23321
Showing 3 changed files with 20 additions and 17 deletions.
5 changes: 3 additions & 2 deletions integration-tests/contracts/contract_vrf_models.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"

"github.com/smartcontractkit/chainlink-testing-framework/contracts/ethereum"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/dkg"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/vrf_beacon"
)
@@ -35,7 +35,8 @@ type VRFCoordinatorV2 interface {
maxGasLimit uint32,
stalenessSeconds uint32,
gasAfterPaymentCalculation uint32,
fallbackWeiPerUnitLink *big.Int, feeConfig ethereum.VRFCoordinatorV2FeeConfig,
fallbackWeiPerUnitLink *big.Int,
feeConfig vrf_coordinator_v2.VRFCoordinatorV2FeeConfig,
) error
RegisterProvingKey(
oracleAddr string,
28 changes: 15 additions & 13 deletions integration-tests/contracts/ethereum_vrf_contracts.go
Original file line number Diff line number Diff line change
@@ -19,6 +19,9 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/contracts/ethereum"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_blockhash_store"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_consumer_v2"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/dkg"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/vrf_beacon"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ocr2vrf/generated/vrf_beacon_consumer"
@@ -68,14 +71,14 @@ func (e *EthereumContractDeployer) DeployVRFCoordinatorV2(linkAddr string, bhsAd
auth *bind.TransactOpts,
backend bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return ethereum.DeployVRFCoordinatorV2(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr), common.HexToAddress(linkEthFeedAddr))
return vrf_coordinator_v2.DeployVRFCoordinatorV2(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr), common.HexToAddress(linkEthFeedAddr))
})
if err != nil {
return nil, err
}
return &EthereumVRFCoordinatorV2{
client: e.client,
coordinator: instance.(*ethereum.VRFCoordinatorV2),
coordinator: instance.(*vrf_coordinator_v2.VRFCoordinatorV2),
address: address,
}, err
}
@@ -86,14 +89,14 @@ func (e *EthereumContractDeployer) DeployVRFCoordinator(linkAddr string, bhsAddr
auth *bind.TransactOpts,
backend bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return ethereum.DeployVRFCoordinator(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr))
return solidity_vrf_coordinator_interface.DeployVRFCoordinator(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr))
})
if err != nil {
return nil, err
}
return &EthereumVRFCoordinator{
client: e.client,
coordinator: instance.(*ethereum.VRFCoordinator),
coordinator: instance.(*solidity_vrf_coordinator_interface.VRFCoordinator),
address: address,
}, err
}
@@ -129,7 +132,7 @@ func (e *EthereumContractDeployer) DeployVRFConsumerV2(linkAddr string, coordina
}
return &EthereumVRFConsumerV2{
client: e.client,
consumer: instance.(*ethereum.VRFConsumerV2),
consumer: instance.(*vrf_consumer_v2.VRFConsumerV2),
address: address,
}, err
}
@@ -292,7 +295,7 @@ func (v *EthereumBlockhashStore) Address() string {
type EthereumVRFCoordinatorV2 struct {
address *common.Address
client blockchain.EVMClient
coordinator *ethereum.VRFCoordinatorV2
coordinator *vrf_coordinator_v2.VRFCoordinatorV2
}

func (v *EthereumVRFCoordinatorV2) Address() string {
@@ -311,7 +314,7 @@ func (v *EthereumVRFCoordinatorV2) HashOfKey(ctx context.Context, pubKey [2]*big
return hash, nil
}

func (v *EthereumVRFCoordinatorV2) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig ethereum.VRFCoordinatorV2FeeConfig) error {
func (v *EthereumVRFCoordinatorV2) SetConfig(minimumRequestConfirmations uint16, maxGasLimit uint32, stalenessSeconds uint32, gasAfterPaymentCalculation uint32, fallbackWeiPerUnitLink *big.Int, feeConfig vrf_coordinator_v2.VRFCoordinatorV2FeeConfig) error {
opts, err := v.client.TransactionOpts(v.client.GetDefaultWallet())
if err != nil {
return err
@@ -362,7 +365,7 @@ func (v *EthereumVRFCoordinatorV2) CreateSubscription() error {
type EthereumVRFCoordinator struct {
address *common.Address
client blockchain.EVMClient
coordinator *ethereum.VRFCoordinator
coordinator *solidity_vrf_coordinator_interface.VRFCoordinator
}

func (v *EthereumVRFCoordinator) Address() string {
@@ -404,7 +407,7 @@ func (v *EthereumVRFCoordinator) RegisterProvingKey(
type EthereumVRFConsumerV2 struct {
address *common.Address
client blockchain.EVMClient
consumer *ethereum.VRFConsumerV2
consumer *vrf_consumer_v2.VRFConsumerV2
}

// EthereumVRFv2Consumer represents VRFv2 consumer contract
@@ -428,7 +431,7 @@ func (v *EthereumVRFConsumerV2) CreateFundedSubscription(funds *big.Int) error {
if err != nil {
return err
}
tx, err := v.consumer.TestCreateSubscriptionAndFund(opts, funds)
tx, err := v.consumer.CreateSubscriptionAndFund(opts, funds)
if err != nil {
return err
}
@@ -474,7 +477,7 @@ func (v *EthereumVRFConsumerV2) RequestRandomness(hash [32]byte, subID uint64, c
if err != nil {
return err
}
tx, err := v.consumer.TestRequestRandomness(opts, hash, subID, confs, gasLimit, numWords)
tx, err := v.consumer.RequestRandomness(opts, hash, subID, confs, gasLimit, numWords)
if err != nil {
return err
}
@@ -549,7 +552,7 @@ func (v *EthereumVRFConsumerV2) GetAllRandomWords(ctx context.Context, num int)
// LoadExistingConsumer loads an EthereumVRFConsumerV2 with a specified address
func (v *EthereumVRFConsumerV2) LoadExistingConsumer(address string, client blockchain.EVMClient) error {
a := common.HexToAddress(address)
consumer, err := ethereum.NewVRFConsumerV2(a, client.(*blockchain.EthereumClient).Client)
consumer, err := vrf_consumer_v2.NewVRFConsumerV2(a, client.(*blockchain.EthereumClient).Client)
if err != nil {
return err
}
@@ -1048,7 +1051,6 @@ type EthereumVRFBeaconConsumer struct {
address *common.Address
client blockchain.EVMClient
vrfBeaconConsumer *vrf_beacon_consumer.BeaconVRFConsumer
abi string
}

func (consumer *EthereumVRFBeaconConsumer) Address() string {
4 changes: 2 additions & 2 deletions integration-tests/smoke/vrfv2_test.go
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ import (
"github.com/smartcontractkit/chainlink-env/environment"
"github.com/smartcontractkit/chainlink-env/pkg/helm/chainlink"
"github.com/smartcontractkit/chainlink-testing-framework/blockchain"
"github.com/smartcontractkit/chainlink-testing-framework/contracts/ethereum"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2"

eth "github.com/smartcontractkit/chainlink-env/pkg/helm/ethereum"

@@ -77,7 +77,7 @@ func TestVRFv2Basic(t *testing.T) {
86400,
33825,
linkEthFeedResponse,
ethereum.VRFCoordinatorV2FeeConfig{
vrf_coordinator_v2.VRFCoordinatorV2FeeConfig{
FulfillmentFlatFeeLinkPPMTier1: 1,
FulfillmentFlatFeeLinkPPMTier2: 1,
FulfillmentFlatFeeLinkPPMTier3: 1,

0 comments on commit ad23321

Please sign in to comment.