Skip to content

Commit

Permalink
feature: add vrf smoke superscript (#10739)
Browse files Browse the repository at this point in the history
* feature: add vrf smoke superscript

Add a new superscript that will deploy the VRF universe and run a single
request and fulfillment from a new VRF key that is generated afresh with
each run of the superscript. This is useful to test out new chains and
whether they're usable for VRF.

* feature: add bhs smoke
  • Loading branch information
makramkd authored Sep 21, 2023
1 parent e1896a8 commit 48ad8fb
Show file tree
Hide file tree
Showing 3 changed files with 439 additions and 2 deletions.
7 changes: 6 additions & 1 deletion core/scripts/common/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ func explorerLinkPrefix(chainID int64) (prefix string) {
case 1666700000, 1666700001, 1666700002, 1666700003: // Harmony testnet
prefix = "https://explorer.testnet.harmony.one"

case 84531:
prefix = "https://goerli.basescan.org"
case 8453:
prefix = "https://basescan.org"

default: // Unknown chain, return prefix as-is
prefix = ""
}
Expand Down Expand Up @@ -410,7 +415,7 @@ func BinarySearch(top, bottom *big.Int, test func(amount *big.Int) bool) *big.In
return bottom
}

// Get RLP encoded headers of a list of block numbers
// GetRlpHeaders gets RLP encoded headers of a list of block numbers
// Makes RPC network call eth_getBlockByNumber to blockchain RPC node
// to fetch header info
func GetRlpHeaders(env Environment, blockNumbers []*big.Int, getParentBlocks bool) (headers [][]byte, hashes []string, err error) {
Expand Down
8 changes: 7 additions & 1 deletion core/scripts/vrfv2plus/testnet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"encoding/hex"
"flag"
"fmt"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics"
"log"
"math/big"
"os"
"strings"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -46,12 +47,17 @@ import (

var (
batchCoordinatorV2PlusABI = evmtypes.MustGetABI(batch_vrf_coordinator_v2plus.BatchVRFCoordinatorV2PlusABI)
coordinatorV2PlusABI = evmtypes.MustGetABI(vrf_coordinator_v2plus.VRFCoordinatorV2PlusABI)
)

func main() {
e := helpers.SetupEnv(false)

switch os.Args[1] {
case "smoke":
smokeTestVRF(e)
case "smoke-bhs":
smokeTestBHS(e)
case "manual-fulfill":
cmd := flag.NewFlagSet("manual-fulfill", flag.ExitOnError)
// In order to get the tx data for a fulfillment transaction, you can grep the
Expand Down
Loading

0 comments on commit 48ad8fb

Please sign in to comment.