From fb4c61dbc7770a74650f30148cef91bdf3822f5f Mon Sep 17 00:00:00 2001 From: Rachit Sonthalia Date: Wed, 17 Jul 2024 18:55:31 +0530 Subject: [PATCH] address comments --- test/ethtransfer_test.go | 7 +------ test/operations/operations.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) 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