@@ -2,6 +2,7 @@ package examples
22
33import (
44 "testing"
5+ "time"
56
67 "github.com/stretchr/testify/require"
78
@@ -11,6 +12,7 @@ import (
1112 "github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake"
1213 "github.com/smartcontractkit/chainlink-testing-framework/framework/components/jd"
1314 ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
15+ "github.com/smartcontractkit/chainlink-testing-framework/framework/rpc"
1416)
1517
1618type CfgJDNodeSet struct {
@@ -26,17 +28,49 @@ func TestJDNodeSet(t *testing.T) {
2628
2729 blockchainInfo , err := blockchain .NewBlockchainNetwork (in .Blockchains [0 ])
2830 require .NoError (t , err )
29- _ , err = fake .NewFakeDataProvider (in .MockedDataProvider )
31+
32+ // by default, nodeset is connected to the first Anvil but if you need more chains you can do it like that
33+ // srcNetworkCfg, err := clnode.NewNetworkCfg(&clnode.EVMNetworkConfig{
34+ // MinIncomingConfirmations: 1,
35+ // MinContractPayment: "0.00001 link",
36+ // ChainID: bcSrc.ChainID,
37+ // EVMNodes: []*clnode.EVMNode{
38+ // {
39+ // SendOnly: false,
40+ // Order: 100,
41+ // },
42+ // },
43+ // }, bcSrc)
44+ // in.NodeSets[0].NodeSpecs[0].Node.TestConfigOverrides = srcNetworkCfg
45+
46+ jobDistributorInfo , err := jd .NewJD (in .JD )
3047 require .NoError (t , err )
48+
49+ // connect JD with NodeSet
50+
3151 nodeSetInfo , err := ns .NewSharedDBNodeSet (in .NodeSets [0 ], blockchainInfo )
3252 require .NoError (t , err )
53+ _ , err = fake .NewFakeDataProvider (in .MockedDataProvider )
54+ require .NoError (t , err )
3355
34- jobDistributorInfo , err := jd .NewJD (in .JD )
56+ // set up your contracts here with 0s blocks, control the mining speed later
57+
58+ miner := rpc .NewRemoteAnvilMiner (blockchainInfo .Nodes [0 ].ExternalHTTPUrl , nil )
59+ miner .MinePeriodically (1 * time .Second )
60+ clClients , err := clclient .New (nodeSetInfo .CLNodes )
3561 require .NoError (t , err )
3662
37- t .Run ("test changesets with forked network/JD state" , func (t * testing.T ) {
38- clClients , err := clclient .New (nodeSetInfo .CLNodes )
39- require .NoError (t , err )
63+ t .Run ("test #1" , func (t * testing.T ) {
64+ _ = clClients
65+ // create some jobs
66+ //_, _, err = c[0].CreateJobRaw()
67+ //require.NoError(t, err)
68+ _ = nodeSetInfo
69+ _ = blockchainInfo
70+ _ = jobDistributorInfo
71+ })
72+
73+ t .Run ("test #2" , func (t * testing.T ) {
4074 _ = clClients
4175 // create some jobs
4276 //_, _, err = c[0].CreateJobRaw()
0 commit comments