-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from smartcontractkit/tx-v3
use TransactionV3
- Loading branch information
Showing
8 changed files
with
210 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,100 @@ | ||
package infra_deployments_test | ||
|
||
import ( | ||
"fmt" | ||
"net/url" | ||
"testing" | ||
//import ( | ||
//"fmt" | ||
//"net/url" | ||
//"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
//"github.com/stretchr/testify/require" | ||
|
||
"github.com/smartcontractkit/chainlink-starknet/integration-tests/common" | ||
"github.com/smartcontractkit/chainlink-starknet/ops/gauntlet" | ||
"github.com/smartcontractkit/chainlink-starknet/ops/utils" | ||
"github.com/smartcontractkit/chainlink/integration-tests/client" | ||
) | ||
//"github.com/smartcontractkit/chainlink-starknet/integration-tests/common" | ||
//"github.com/smartcontractkit/chainlink-starknet/ops/gauntlet" | ||
//"github.com/smartcontractkit/chainlink-starknet/ops/utils" | ||
//"github.com/smartcontractkit/chainlink/integration-tests/client" | ||
//) | ||
|
||
const ( | ||
L2RpcUrl = "https://alpha4-2.starknet.io" | ||
P2pPort = "6691" | ||
) | ||
//const ( | ||
//L2RpcUrl = "https://alpha4-2.starknet.io" | ||
//P2pPort = "6691" | ||
//) | ||
|
||
var ( | ||
observationSource = ` | ||
val [type="bridge" name="bridge-coinmetrics" requestData=<{"data": {"from":"LINK","to":"USD"}}>] | ||
parse [type="jsonparse" path="result"] | ||
val -> parse | ||
` | ||
juelsPerFeeCoinSource = `""" | ||
sum [type="sum" values=<[451000]> ] | ||
sum | ||
""" | ||
` | ||
) | ||
//var ( | ||
//observationSource = ` | ||
//val [type="bridge" name="bridge-coinmetrics" requestData=<{"data": {"from":"LINK","to":"USD"}}>] | ||
//parse [type="jsonparse" path="result"] | ||
//val -> parse | ||
//` | ||
//juelsPerFeeCoinSource = `""" | ||
//sum [type="sum" values=<[451000]> ] | ||
//sum | ||
//""" | ||
//` | ||
//) | ||
|
||
func createKeys(testState *testing.T) ([]*client.ChainlinkK8sClient, error) { | ||
urls := [][]string{ | ||
// Node access params | ||
{"NODE_URL", "NODE_USER", "NODE_PASS"}, | ||
} | ||
var clients []*client.ChainlinkK8sClient | ||
//func createKeys(testState *testing.T) ([]*client.ChainlinkK8sClient, error) { | ||
//urls := [][]string{ | ||
//// Node access params | ||
//{"NODE_URL", "NODE_USER", "NODE_PASS"}, | ||
//} | ||
//var clients []*client.ChainlinkK8sClient | ||
|
||
for _, nodeUrl := range urls { | ||
u, _ := url.Parse(nodeUrl[0]) | ||
c, err := client.NewChainlinkK8sClient(&client.ChainlinkConfig{ | ||
URL: nodeUrl[0], | ||
Email: nodeUrl[1], | ||
Password: nodeUrl[2], | ||
InternalIP: u.Host, | ||
}, "", "") | ||
if err != nil { | ||
return nil, err | ||
} | ||
key, _ := c.MustReadP2PKeys() | ||
if key == nil { | ||
_, _, err = c.CreateP2PKey() | ||
require.NoError(testState, err) | ||
} | ||
clients = append(clients, c) | ||
} | ||
return clients, nil | ||
} | ||
func TestOCRBasic(testState *testing.T) { | ||
var err error | ||
t := &common.Test{} | ||
t.Common = common.New(testState) | ||
t.Cc = &common.ChainlinkClient{} | ||
t.Common.P2PPort = P2pPort | ||
t.Cc.ChainlinkNodes, err = createKeys(testState) | ||
require.NoError(testState, err) | ||
t.Cc.NKeys, _, err = client.CreateNodeKeysBundle(t.GetChainlinkNodes(), t.Common.ChainName, t.Common.ChainId) | ||
require.NoError(testState, err) | ||
for _, n := range t.Cc.ChainlinkNodes { | ||
_, _, err = n.CreateStarkNetChain(&client.StarkNetChainAttributes{ | ||
Type: t.Common.ChainName, | ||
ChainID: t.Common.ChainId, | ||
Config: client.StarkNetChainConfig{}, | ||
}) | ||
require.NoError(testState, err) | ||
_, _, err = n.CreateStarkNetNode(&client.StarkNetNodeAttributes{ | ||
Name: t.Common.ChainName, | ||
ChainID: t.Common.ChainId, | ||
Url: L2RpcUrl, | ||
}) | ||
require.NoError(testState, err) | ||
} | ||
t.Common.Testnet = true | ||
t.Common.L2RPCUrl = L2RpcUrl | ||
t.Sg, err = gauntlet.NewStarknetGauntlet(fmt.Sprintf("%s/", utils.ProjectRoot)) | ||
require.NoError(testState, err, "Could not get a new gauntlet struct") | ||
err = t.Sg.SetupNetwork(t.Common.L2RPCUrl) | ||
require.NoError(testState, err, "Setting up gauntlet network should not fail") | ||
err = t.DeployGauntlet(0, 100000000000, 9, "auto", 1, 1) | ||
require.NoError(testState, err, "Deploying contracts should not fail") | ||
t.SetBridgeTypeAttrs(&client.BridgeTypeAttributes{ | ||
Name: "bridge-coinmetrics", | ||
URL: "ADAPTER_URL", // ADAPTER_URL e.g https://adapters.main.sand.cldev.sh/coinmetrics | ||
}) | ||
//for _, nodeUrl := range urls { | ||
//u, _ := url.Parse(nodeUrl[0]) | ||
//c, err := client.NewChainlinkK8sClient(&client.ChainlinkConfig{ | ||
//URL: nodeUrl[0], | ||
//Email: nodeUrl[1], | ||
//Password: nodeUrl[2], | ||
//InternalIP: u.Host, | ||
//}, "", "") | ||
//if err != nil { | ||
//return nil, err | ||
//} | ||
//key, _ := c.MustReadP2PKeys() | ||
//if key == nil { | ||
//_, _, err = c.CreateP2PKey() | ||
//require.NoError(testState, err) | ||
//} | ||
//clients = append(clients, c) | ||
//} | ||
//return clients, nil | ||
//} | ||
//func TestOCRBasic(testState *testing.T) { | ||
//var err error | ||
//t := &common.Test{} | ||
//t.Common = common.New(testState) | ||
//t.Cc = &common.ChainlinkClient{} | ||
//t.Common.P2PPort = P2pPort | ||
//t.Cc.ChainlinkNodes, err = createKeys(testState) | ||
//require.NoError(testState, err) | ||
//t.Cc.NKeys, _, err = client.CreateNodeKeysBundle(t.GetChainlinkNodes(), t.Common.ChainName, t.Common.ChainId) | ||
//require.NoError(testState, err) | ||
//for _, n := range t.Cc.ChainlinkNodes { | ||
//_, _, err = n.CreateStarkNetChain(&client.StarkNetChainAttributes{ | ||
//Type: t.Common.ChainName, | ||
//ChainID: t.Common.ChainId, | ||
//Config: client.StarkNetChainConfig{}, | ||
//}) | ||
//require.NoError(testState, err) | ||
//_, _, err = n.CreateStarkNetNode(&client.StarkNetNodeAttributes{ | ||
//Name: t.Common.ChainName, | ||
//ChainID: t.Common.ChainId, | ||
//Url: L2RpcUrl, | ||
//}) | ||
//require.NoError(testState, err) | ||
//} | ||
//t.Common.Testnet = true | ||
//t.Common.L2RPCUrl = L2RpcUrl | ||
//t.Sg, err = gauntlet.NewStarknetGauntlet(fmt.Sprintf("%s/", utils.ProjectRoot)) | ||
//require.NoError(testState, err, "Could not get a new gauntlet struct") | ||
//err = t.Sg.SetupNetwork(t.Common.L2RPCUrl) | ||
//require.NoError(testState, err, "Setting up gauntlet network should not fail") | ||
//err = t.DeployGauntlet(0, 100000000000, 9, "auto", 1, 1) | ||
//require.NoError(testState, err, "Deploying contracts should not fail") | ||
//t.SetBridgeTypeAttrs(&client.BridgeTypeAttributes{ | ||
//Name: "bridge-coinmetrics", | ||
//URL: "ADAPTER_URL", // ADAPTER_URL e.g https://adapters.main.sand.cldev.sh/coinmetrics | ||
//}) | ||
|
||
err = t.Common.CreateJobsForContract(t.Cc, observationSource, juelsPerFeeCoinSource, t.OCRAddr, t.AccountAddresses) | ||
require.NoError(testState, err) | ||
} | ||
//err = t.Common.CreateJobsForContract(t.Cc, observationSource, juelsPerFeeCoinSource, t.OCRAddr, t.AccountAddresses) | ||
//require.NoError(testState, err) | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
package soak_test | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"testing" | ||
//import ( | ||
//"flag" | ||
//"fmt" | ||
//"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"go.uber.org/zap/zapcore" | ||
//"github.com/stretchr/testify/require" | ||
//"go.uber.org/zap/zapcore" | ||
|
||
"github.com/smartcontractkit/chainlink-starknet/integration-tests/common" | ||
"github.com/smartcontractkit/chainlink-starknet/ops/gauntlet" | ||
"github.com/smartcontractkit/chainlink-starknet/ops/utils" | ||
//"github.com/smartcontractkit/chainlink-starknet/integration-tests/common" | ||
//"github.com/smartcontractkit/chainlink-starknet/ops/gauntlet" | ||
//"github.com/smartcontractkit/chainlink-starknet/ops/utils" | ||
|
||
"github.com/smartcontractkit/chainlink/integration-tests/actions" | ||
) | ||
//"github.com/smartcontractkit/chainlink/integration-tests/actions" | ||
//) | ||
|
||
var ( | ||
keepAlive bool | ||
err error | ||
testState *common.Test | ||
decimals = 9 | ||
) | ||
//var ( | ||
//keepAlive bool | ||
//err error | ||
//testState *common.Test | ||
//decimals = 9 | ||
//) | ||
|
||
func init() { | ||
flag.BoolVar(&keepAlive, "keep-alive", false, "enable to keep the cluster alive") | ||
} | ||
func TestOCRSoak(t *testing.T) { | ||
testState = &common.Test{ | ||
T: t, | ||
} | ||
testState.Common = common.New(t) | ||
// Setting this to the root of the repo for cmd exec func for Gauntlet | ||
testState.Sg, err = gauntlet.NewStarknetGauntlet(fmt.Sprintf("%s/", utils.ProjectRoot)) | ||
require.NoError(t, err, "Could not get a new gauntlet struct") | ||
testState.DeployCluster() | ||
require.NoError(t, err, "Deploying cluster should not fail") | ||
if testState.Common.Env.WillUseRemoteRunner() { | ||
return // short circuit here if using a remote runner | ||
} | ||
err = testState.Sg.SetupNetwork(testState.Common.L2RPCUrl) | ||
require.NoError(t, err, "Setting up network should not fail") | ||
err = testState.DeployGauntlet(0, 100000000000, decimals, "auto", 1, 1) | ||
require.NoError(t, err, "Deploying contracts should not fail") | ||
if !testState.Common.Testnet { | ||
testState.Devnet.AutoLoadState(testState.OCR2Client, testState.OCRAddr) | ||
} | ||
err = testState.ValidateRounds(99999999, true) | ||
require.NoError(t, err, "Validating round should not fail") | ||
t.Cleanup(func() { | ||
err = actions.TeardownSuite(t, testState.Common.Env, testState.Cc.ChainlinkNodes, nil, zapcore.ErrorLevel, nil, nil) | ||
require.NoError(t, err, "Error tearing down environment") | ||
}) | ||
} | ||
//func init() { | ||
//flag.BoolVar(&keepAlive, "keep-alive", false, "enable to keep the cluster alive") | ||
//} | ||
//func TestOCRSoak(t *testing.T) { | ||
//testState = &common.Test{ | ||
//T: t, | ||
//} | ||
//testState.Common = common.New(t) | ||
//// Setting this to the root of the repo for cmd exec func for Gauntlet | ||
//testState.Sg, err = gauntlet.NewStarknetGauntlet(fmt.Sprintf("%s/", utils.ProjectRoot)) | ||
//require.NoError(t, err, "Could not get a new gauntlet struct") | ||
//testState.DeployCluster() | ||
//require.NoError(t, err, "Deploying cluster should not fail") | ||
//if testState.Common.Env.WillUseRemoteRunner() { | ||
//return // short circuit here if using a remote runner | ||
//} | ||
//err = testState.Sg.SetupNetwork(testState.Common.L2RPCUrl) | ||
//require.NoError(t, err, "Setting up network should not fail") | ||
//err = testState.DeployGauntlet(0, 100000000000, decimals, "auto", 1, 1) | ||
//require.NoError(t, err, "Deploying contracts should not fail") | ||
//if !testState.Common.Testnet { | ||
//testState.Devnet.AutoLoadState(testState.OCR2Client, testState.OCRAddr) | ||
//} | ||
//err = testState.ValidateRounds(99999999, true) | ||
//require.NoError(t, err, "Validating round should not fail") | ||
//t.Cleanup(func() { | ||
//err = actions.TeardownSuite(t, testState.Common.Env, testState.Cc.ChainlinkNodes, nil, zapcore.ErrorLevel, nil, nil) | ||
//require.NoError(t, err, "Error tearing down environment") | ||
//}) | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.