From 61c2cda55d7c41d64d07f292d4397419bbbe2845 Mon Sep 17 00:00:00 2001 From: Matt <98158711+BedrockSquirrel@users.noreply.github.com> Date: Tue, 3 Oct 2023 11:33:10 +0100 Subject: [PATCH] Add SepoliaTestnet as an environment for network tests (#1574) --- integration/networktest/env/network_setup.go | 18 ++++++++++++++---- integration/networktest/env/testnet.go | 8 ++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/integration/networktest/env/network_setup.go b/integration/networktest/env/network_setup.go index fecffd1d75..4a91d78d24 100644 --- a/integration/networktest/env/network_setup.go +++ b/integration/networktest/env/network_setup.go @@ -5,10 +5,20 @@ import ( "github.com/obscuronet/go-obscuro/integration/networktest" ) +func SepoliaTestnet() networktest.Environment { + connector := NewTestnetConnector( + "http://erpc.sepolia-testnet.obscu.ro:80", // this is actually a validator... + []string{"http://erpc.sepolia-testnet.obscu.ro:80"}, + "http://sepolia-testnet-faucet.uksouth.azurecontainer.io/fund/eth", + "https://rpc.sepolia.org/", + ) + return &testnetEnv{connector} +} + func Testnet() networktest.Environment { connector := NewTestnetConnector( - "http://erpc.testnet.obscu.ro:80", - []string{"http://erpc.testnet.obscu.ro:80"}, // for now we'll just use sequencer as validator node... todo (@matt) + "http://erpc.testnet.obscu.ro:80", // this is actually a validator... + []string{"http://erpc.testnet.obscu.ro:80"}, "http://testnet-faucet.uksouth.azurecontainer.io/fund/eth", "ws://testnet-eth2network.uksouth.cloudapp.azure.com:9000", ) @@ -17,8 +27,8 @@ func Testnet() networktest.Environment { func DevTestnet() networktest.Environment { connector := NewTestnetConnector( - "http://erpc.dev-testnet.obscu.ro:80", - []string{"http://erpc.dev-testnet.obscu.ro:80"}, // for now we'll just use sequencer as validator node... todo (@matt) + "http://erpc.dev-testnet.obscu.ro:80", // this is actually a validator... + []string{"http://erpc.dev-testnet.obscu.ro:80"}, "http://dev-testnet-faucet.uksouth.azurecontainer.io/fund/eth", "ws://dev-testnet-eth2network.uksouth.cloudapp.azure.com:9000", ) diff --git a/integration/networktest/env/testnet.go b/integration/networktest/env/testnet.go index a90fda057a..0e4a3868a5 100644 --- a/integration/networktest/env/testnet.go +++ b/integration/networktest/env/testnet.go @@ -28,7 +28,7 @@ type testnetConnector struct { seqRPCAddress string validatorRPCAddresses []string faucetHTTPAddress string - l1WSURL string + l1RPCURL string faucetWallet *userwallet.UserWallet } @@ -37,7 +37,7 @@ func NewTestnetConnector(seqRPCAddr string, validatorRPCAddressses []string, fau seqRPCAddress: seqRPCAddr, validatorRPCAddresses: validatorRPCAddressses, faucetHTTPAddress: faucetHTTPAddress, - l1WSURL: l1WSURL, + l1RPCURL: l1WSURL, } } @@ -50,7 +50,7 @@ func NewTestnetConnectorWithFaucetAccount(seqRPCAddr string, validatorRPCAddress seqRPCAddress: seqRPCAddr, validatorRPCAddresses: validatorRPCAddressses, faucetWallet: userwallet.NewUserWallet(ecdsaKey, validatorRPCAddressses[0], testlog.Logger(), userwallet.WithChainID(big.NewInt(integration.ObscuroChainID))), - l1WSURL: l1RPCAddress, + l1RPCURL: l1RPCAddress, } } @@ -94,7 +94,7 @@ func (t *testnetConnector) NumValidators() int { } func (t *testnetConnector) GetL1Client() (ethadapter.EthClient, error) { - client, err := ethadapter.NewEthClientFromURL(t.l1WSURL, time.Minute, gethcommon.Address{}, testlog.Logger()) + client, err := ethadapter.NewEthClientFromURL(t.l1RPCURL, time.Minute, gethcommon.Address{}, testlog.Logger()) if err != nil { return nil, err }