Skip to content

Commit

Permalink
fix(eventindexer): update config tests (#14912)
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerLamTd authored Oct 7, 2023
1 parent c85e162 commit beab49b
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 95 deletions.
12 changes: 6 additions & 6 deletions packages/eventindexer/generator/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}))
}
42 changes: 21 additions & 21 deletions packages/eventindexer/indexer/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}))
}
48 changes: 24 additions & 24 deletions packages/relayer/indexer/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}))
}
88 changes: 44 additions & 44 deletions packages/relayer/processor/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}))
Expand All @@ -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")
}

0 comments on commit beab49b

Please sign in to comment.