From 545e2e8df46f8f24c9bec61219f2653aeec94ecc Mon Sep 17 00:00:00 2001 From: RogerLamTd Date: Fri, 6 Oct 2023 18:02:08 -0700 Subject: [PATCH] switch from - to -- like in client for config tests --- .../eventindexer/generator/config_test.go | 12 +-- packages/eventindexer/indexer/config_test.go | 42 ++++----- packages/relayer/indexer/config_test.go | 48 +++++----- packages/relayer/processor/config_test.go | 88 +++++++++---------- 4 files changed, 95 insertions(+), 95 deletions(-) diff --git a/packages/eventindexer/generator/config_test.go b/packages/eventindexer/generator/config_test.go index f38f1ed120..290e03421e 100644 --- a/packages/eventindexer/generator/config_test.go +++ b/packages/eventindexer/generator/config_test.go @@ -48,11 +48,11 @@ func TestNewConfigFromCliContext(t *testing.T) { assert.Nil(t, app.Run([]string{ "TestNewConfigFromCliContext", - "-" + flags.DatabaseUsername.Name, "dbuser", - "-" + flags.DatabasePassword.Name, "dbpass", - "-" + flags.DatabaseHost.Name, "dbhost", - "-" + flags.DatabaseName.Name, "dbname", - "-" + flags.GenesisDate.Name, "2023-07-07", - "-" + flags.Regenerate.Name, "true", + "--" + flags.DatabaseUsername.Name, "dbuser", + "--" + flags.DatabasePassword.Name, "dbpass", + "--" + flags.DatabaseHost.Name, "dbhost", + "--" + flags.DatabaseName.Name, "dbname", + "--" + flags.GenesisDate.Name, "2023-07-07", + "--" + flags.Regenerate.Name, "true", })) } diff --git a/packages/eventindexer/indexer/config_test.go b/packages/eventindexer/indexer/config_test.go index 010c8dcb86..2e026fa4f4 100644 --- a/packages/eventindexer/indexer/config_test.go +++ b/packages/eventindexer/indexer/config_test.go @@ -73,26 +73,26 @@ func TestNewConfigFromCliContext(t *testing.T) { assert.Nil(t, app.Run([]string{ "TestNewConfigFromCliContext", - "-" + flags.DatabaseUsername.Name, "dbuser", - "-" + flags.DatabasePassword.Name, "dbpass", - "-" + flags.DatabaseHost.Name, "dbhost", - "-" + flags.DatabaseName.Name, "dbname", - "-" + flags.RPCUrl.Name, "rpcUrl", - "-" + flags.L1TaikoAddress.Name, l1TaikoAddress, - "-" + flags.BridgeAddress.Name, bridgeAddress, - "-" + flags.SwapAddresses.Name, swapAddresses, - "-" + flags.HTTPPort.Name, httpPort, - "-" + flags.MetricsHTTPPort.Name, metricsHttpPort, - "-" + flags.CORSOrigins.Name, corsOrigins, - "-" + flags.DatabaseMaxIdleConns.Name, databaseMaxIdleConns, - "-" + flags.DatabaseMaxOpenConns.Name, databaseMaxOpenConns, - "-" + flags.DatabaseConnMaxLifetime.Name, databaseMaxConnLifetime, - "-" + flags.ETHClientTimeout.Name, ethClientTimeout, - "-" + flags.BlockBatchSize.Name, blockBatchSize, - "-" + flags.SubscriptionBackoff.Name, subscriptionBackoff, - "-" + flags.SyncMode.Name, syncMode, - "-" + flags.WatchMode.Name, watchMode, - "-" + flags.IndexNFTs.Name, "true", - "-" + flags.Layer.Name, layer, + "--" + flags.DatabaseUsername.Name, "dbuser", + "--" + flags.DatabasePassword.Name, "dbpass", + "--" + flags.DatabaseHost.Name, "dbhost", + "--" + flags.DatabaseName.Name, "dbname", + "--" + flags.RPCUrl.Name, "rpcUrl", + "--" + flags.L1TaikoAddress.Name, l1TaikoAddress, + "--" + flags.BridgeAddress.Name, bridgeAddress, + "--" + flags.SwapAddresses.Name, swapAddresses, + "--" + flags.HTTPPort.Name, httpPort, + "--" + flags.MetricsHTTPPort.Name, metricsHttpPort, + "--" + flags.CORSOrigins.Name, corsOrigins, + "--" + flags.DatabaseMaxIdleConns.Name, databaseMaxIdleConns, + "--" + flags.DatabaseMaxOpenConns.Name, databaseMaxOpenConns, + "--" + flags.DatabaseConnMaxLifetime.Name, databaseMaxConnLifetime, + "--" + flags.ETHClientTimeout.Name, ethClientTimeout, + "--" + flags.BlockBatchSize.Name, blockBatchSize, + "--" + flags.SubscriptionBackoff.Name, subscriptionBackoff, + "--" + flags.SyncMode.Name, syncMode, + "--" + flags.WatchMode.Name, watchMode, + "--" + flags.IndexNFTs.Name, + "--" + flags.Layer.Name, layer, })) } diff --git a/packages/relayer/indexer/config_test.go b/packages/relayer/indexer/config_test.go index d39e43a032..1bdb9a7df7 100644 --- a/packages/relayer/indexer/config_test.go +++ b/packages/relayer/indexer/config_test.go @@ -84,29 +84,29 @@ func TestNewConfigFromCliContext(t *testing.T) { assert.Nil(t, app.Run([]string{ "TestNewConfigFromCliContext", - "-" + flags.DatabaseUsername.Name, "dbuser", - "-" + flags.DatabasePassword.Name, "dbpass", - "-" + flags.DatabaseHost.Name, "dbhost", - "-" + flags.DatabaseName.Name, "dbname", - "-" + flags.QueueUsername.Name, "queuename", - "-" + flags.QueuePassword.Name, "queuepassword", - "-" + flags.QueueHost.Name, "queuehost", - "-" + flags.QueuePort.Name, "5555", - "-" + flags.SrcRPCUrl.Name, "srcRpcUrl", - "-" + flags.DestRPCUrl.Name, "destRpcUrl", - "-" + flags.DestBridgeAddress.Name, destBridgeAddr, - "-" + flags.SrcBridgeAddress.Name, srcBridgeAddr, - "-" + flags.SrcTaikoAddress.Name, srcTaikoAddr, - "-" + flags.CORSOrigins.Name, "*", - "-" + flags.ETHClientTimeout.Name, ethClientTimeout, - "-" + flags.DatabaseMaxOpenConns.Name, databaseMaxOpenConns, - "-" + flags.DatabaseMaxIdleConns.Name, databaseMaxIdleConns, - "-" + flags.DatabaseConnMaxLifetime.Name, databaseMaxConnLifetime, - "-" + flags.BlockBatchSize.Name, blockBatchSize, - "-" + flags.MaxNumGoroutines.Name, numGoroutines, - "-" + flags.SubscriptionBackoff.Name, subscriptionBackoff, - "-" + flags.SyncMode.Name, syncMode, - "-" + flags.WatchMode.Name, watchMode, - "-" + flags.HTTPPort.Name, HTTPPort, + "--" + flags.DatabaseUsername.Name, "dbuser", + "--" + flags.DatabasePassword.Name, "dbpass", + "--" + flags.DatabaseHost.Name, "dbhost", + "--" + flags.DatabaseName.Name, "dbname", + "--" + flags.QueueUsername.Name, "queuename", + "--" + flags.QueuePassword.Name, "queuepassword", + "--" + flags.QueueHost.Name, "queuehost", + "--" + flags.QueuePort.Name, "5555", + "--" + flags.SrcRPCUrl.Name, "srcRpcUrl", + "--" + flags.DestRPCUrl.Name, "destRpcUrl", + "--" + flags.DestBridgeAddress.Name, destBridgeAddr, + "--" + flags.SrcBridgeAddress.Name, srcBridgeAddr, + "--" + flags.SrcTaikoAddress.Name, srcTaikoAddr, + "--" + flags.CORSOrigins.Name, "*", + "--" + flags.ETHClientTimeout.Name, ethClientTimeout, + "--" + flags.DatabaseMaxOpenConns.Name, databaseMaxOpenConns, + "--" + flags.DatabaseMaxIdleConns.Name, databaseMaxIdleConns, + "--" + flags.DatabaseConnMaxLifetime.Name, databaseMaxConnLifetime, + "--" + flags.BlockBatchSize.Name, blockBatchSize, + "--" + flags.MaxNumGoroutines.Name, numGoroutines, + "--" + flags.SubscriptionBackoff.Name, subscriptionBackoff, + "--" + flags.SyncMode.Name, syncMode, + "--" + flags.WatchMode.Name, watchMode, + "--" + flags.HTTPPort.Name, HTTPPort, })) } diff --git a/packages/relayer/processor/config_test.go b/packages/relayer/processor/config_test.go index de3928c6e5..6f88f9a547 100644 --- a/packages/relayer/processor/config_test.go +++ b/packages/relayer/processor/config_test.go @@ -85,33 +85,33 @@ func TestNewConfigFromCliContext(t *testing.T) { assert.Nil(t, app.Run([]string{ "TestNewConfigFromCliContext", - "-" + flags.DatabaseUsername.Name, "dbuser", - "-" + flags.DatabasePassword.Name, "dbpass", - "-" + flags.DatabaseHost.Name, "dbhost", - "-" + flags.DatabaseName.Name, "dbname", - "-" + flags.QueueUsername.Name, "queuename", - "-" + flags.QueuePassword.Name, "queuepassword", - "-" + flags.QueueHost.Name, "queuehost", - "-" + flags.QueuePort.Name, "5555", - "-" + flags.SrcRPCUrl.Name, "srcRpcUrl", - "-" + flags.DestRPCUrl.Name, "destRpcUrl", - "-" + flags.DestBridgeAddress.Name, destBridgeAddr, - "-" + flags.SrcSignalServiceAddress.Name, destBridgeAddr, - "-" + flags.DestERC721VaultAddress.Name, destBridgeAddr, - "-" + flags.DestERC20VaultAddress.Name, destBridgeAddr, - "-" + flags.DestERC1155VaultAddress.Name, destBridgeAddr, - "-" + flags.DestTaikoAddress.Name, destBridgeAddr, - "-" + flags.ProcessorPrivateKey.Name, dummyEcdsaKey, - "-" + flags.HeaderSyncInterval.Name, headerSyncInterval, - "-" + flags.Confirmations.Name, confirmations, - "-" + flags.ConfirmationTimeout.Name, confirmationTimeout, - "-" + flags.BackOffRetryInterval.Name, backoffRetryInterval, - "-" + flags.BackOffMaxRetrys.Name, backOffMaxRetrys, - "-" + flags.DatabaseMaxIdleConns.Name, databaseMaxIdleConns, - "-" + flags.DatabaseMaxOpenConns.Name, databaseMaxOpenConns, - "-" + flags.DatabaseConnMaxLifetime.Name, databaseMaxConnLifetime, - "-" + flags.ETHClientTimeout.Name, ethClientTimeout, - "-" + flags.QueuePrefetchCount.Name, "100", + "--" + flags.DatabaseUsername.Name, "dbuser", + "--" + flags.DatabasePassword.Name, "dbpass", + "--" + flags.DatabaseHost.Name, "dbhost", + "--" + flags.DatabaseName.Name, "dbname", + "--" + flags.QueueUsername.Name, "queuename", + "--" + flags.QueuePassword.Name, "queuepassword", + "--" + flags.QueueHost.Name, "queuehost", + "--" + flags.QueuePort.Name, "5555", + "--" + flags.SrcRPCUrl.Name, "srcRpcUrl", + "--" + flags.DestRPCUrl.Name, "destRpcUrl", + "--" + flags.DestBridgeAddress.Name, destBridgeAddr, + "--" + flags.SrcSignalServiceAddress.Name, destBridgeAddr, + "--" + flags.DestERC721VaultAddress.Name, destBridgeAddr, + "--" + flags.DestERC20VaultAddress.Name, destBridgeAddr, + "--" + flags.DestERC1155VaultAddress.Name, destBridgeAddr, + "--" + flags.DestTaikoAddress.Name, destBridgeAddr, + "--" + flags.ProcessorPrivateKey.Name, dummyEcdsaKey, + "--" + flags.HeaderSyncInterval.Name, headerSyncInterval, + "--" + flags.Confirmations.Name, confirmations, + "--" + flags.ConfirmationTimeout.Name, confirmationTimeout, + "--" + flags.BackOffRetryInterval.Name, backoffRetryInterval, + "--" + flags.BackOffMaxRetrys.Name, backOffMaxRetrys, + "--" + flags.DatabaseMaxIdleConns.Name, databaseMaxIdleConns, + "--" + flags.DatabaseMaxOpenConns.Name, databaseMaxOpenConns, + "--" + flags.DatabaseConnMaxLifetime.Name, databaseMaxConnLifetime, + "--" + flags.ETHClientTimeout.Name, ethClientTimeout, + "--" + flags.QueuePrefetchCount.Name, "100", "--" + flags.ProfitableOnly.Name, "--" + flags.EnableTaikoL2.Name, })) @@ -121,22 +121,22 @@ func TestNewConfigFromCliContext_PrivKeyError(t *testing.T) { app := setupApp() assert.ErrorContains(t, app.Run([]string{ "TestingNewConfigFromCliContext", - "-" + flags.DatabaseUsername.Name, "dbuser", - "-" + flags.DatabasePassword.Name, "dbpass", - "-" + flags.DatabaseHost.Name, "dbhost", - "-" + flags.DatabaseName.Name, "dbname", - "-" + flags.QueueUsername.Name, "queuename", - "-" + flags.QueuePassword.Name, "queuepassword", - "-" + flags.QueueHost.Name, "queuehost", - "-" + flags.QueuePort.Name, "5555", - "-" + flags.SrcRPCUrl.Name, "srcRpcUrl", - "-" + flags.DestRPCUrl.Name, "destRpcUrl", - "-" + flags.DestBridgeAddress.Name, destBridgeAddr, - "-" + flags.SrcSignalServiceAddress.Name, destBridgeAddr, - "-" + flags.DestERC721VaultAddress.Name, destBridgeAddr, - "-" + flags.DestERC20VaultAddress.Name, destBridgeAddr, - "-" + flags.DestERC1155VaultAddress.Name, destBridgeAddr, - "-" + flags.DestTaikoAddress.Name, destBridgeAddr, - "-" + flags.ProcessorPrivateKey.Name, "invalid-priv-key", + "--" + flags.DatabaseUsername.Name, "dbuser", + "--" + flags.DatabasePassword.Name, "dbpass", + "--" + flags.DatabaseHost.Name, "dbhost", + "--" + flags.DatabaseName.Name, "dbname", + "--" + flags.QueueUsername.Name, "queuename", + "--" + flags.QueuePassword.Name, "queuepassword", + "--" + flags.QueueHost.Name, "queuehost", + "--" + flags.QueuePort.Name, "5555", + "--" + flags.SrcRPCUrl.Name, "srcRpcUrl", + "--" + flags.DestRPCUrl.Name, "destRpcUrl", + "--" + flags.DestBridgeAddress.Name, destBridgeAddr, + "--" + flags.SrcSignalServiceAddress.Name, destBridgeAddr, + "--" + flags.DestERC721VaultAddress.Name, destBridgeAddr, + "--" + flags.DestERC20VaultAddress.Name, destBridgeAddr, + "--" + flags.DestERC1155VaultAddress.Name, destBridgeAddr, + "--" + flags.DestTaikoAddress.Name, destBridgeAddr, + "--" + flags.ProcessorPrivateKey.Name, "invalid-priv-key", }), "invalid processorPrivateKey") }