diff --git a/test/ethtransfer_test.go b/test/ethtransfer_test.go index e7326c20..b474da7e 100644 --- a/test/ethtransfer_test.go +++ b/test/ethtransfer_test.go @@ -13,12 +13,7 @@ import ( ) func TestEthTransfer(t *testing.T) { - cmd := exec.Command("kurtosis", "port", "print", "cdk-v1", "zkevm-node-rpc-001", "http-rpc") - output, err := cmd.CombinedOutput() - if err != nil { - log.Fatalf("Failed to execute command: %s", err) - } - operations.L2RPCURL = strings.TrimSpace(string(output)) + operations.L2RPCURL = operations.GetL2RPCURL() const amountOfTxsToSend = 10 client, err := jsonrpc.NewClient(operations.L2RPCURL) diff --git a/test/operations/operations.go b/test/operations/operations.go index f4fc7ca9..f9ea6d6b 100644 --- a/test/operations/operations.go +++ b/test/operations/operations.go @@ -21,4 +21,14 @@ func GetL2Wallet() (*wallet.Key, error) { return nil, err } return wallet.NewWalletFromPrivKey(prvKeyBytes) +} + +func GetL2RPCURL() string { + cmd := exec.Command("kurtosis", "port", "print", "cdk-v1", "zkevm-node-rpc-001", "http-rpc") + output, err := cmd.CombinedOutput() + if err != nil { + log.Fatalf("Failed to execute command: %s", err) + } + + return strings.TrimSpace(string(output)) } \ No newline at end of file