From dbfc0e632455029f41f902897e570068db0dfcce Mon Sep 17 00:00:00 2001 From: Francisco Moura Date: Tue, 27 Aug 2024 18:48:51 -0300 Subject: [PATCH] chore(deps): Remove Devnet 'BlockToWaitForOnStartup' as it is no longer needed --- internal/deps/deps.go | 25 +++++++++++-------------- internal/node/machinehash_test.go | 7 +++---- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/internal/deps/deps.go b/internal/deps/deps.go index 628a9d7f0..5dae333b8 100644 --- a/internal/deps/deps.go +++ b/internal/deps/deps.go @@ -20,17 +20,16 @@ import ( ) const ( - DefaultPostgresDatabase = "postgres" - DefaultPostgresDockerImage = "postgres:16-alpine" - DefaultPostgresPort = "5432" - DefaultPostgresUser = "postgres" - DefaultPostgresPassword = "password" - DefaultDevnetDockerImage = "cartesi/rollups-node-devnet:devel" - DefaultDevnetPort = "8545" - DefaultDevnetBlockTime = "1" - DefaultSlotsInAnEpoch = "1" - DefaultDevnetBlockToWaitForOnStartup = "21" - DefaultDevnetNoMining = false + DefaultPostgresDatabase = "postgres" + DefaultPostgresDockerImage = "postgres:16-alpine" + DefaultPostgresPort = "5432" + DefaultPostgresUser = "postgres" + DefaultPostgresPassword = "password" + DefaultDevnetDockerImage = "cartesi/rollups-node-devnet:devel" + DefaultDevnetPort = "8545" + DefaultDevnetBlockTime = "1" + DefaultSlotsInAnEpoch = "1" + DefaultDevnetNoMining = false numPostgresCheckReadyAttempts = 2 pollInterval = 5 * time.Second @@ -63,7 +62,6 @@ type DevnetConfig struct { Port string BlockTime string BlockFinalizationOffset string - BlockToWaitForOnStartup string NoMining bool } @@ -80,7 +78,6 @@ func NewDefaultDepsConfig() *DepsConfig { DefaultDevnetPort, DefaultDevnetBlockTime, DefaultSlotsInAnEpoch, - DefaultDevnetBlockToWaitForOnStartup, DefaultDevnetNoMining, }, } @@ -275,7 +272,7 @@ func Run(ctx context.Context, depsConfig DepsConfig) (*DepsContainers, error) { } else { cmd = append(cmd, "--block-time", depsConfig.Devnet.BlockTime) - waitStrategy = wait.ForLog("Block Number: " + depsConfig.Devnet.BlockToWaitForOnStartup) + waitStrategy = wait.ForLog("Listening on 0.0.0.0:8545") } devNetReq := testcontainers.ContainerRequest{ Image: depsConfig.Devnet.DockerImage, diff --git a/internal/node/machinehash_test.go b/internal/node/machinehash_test.go index 76dc1b24d..313b67212 100644 --- a/internal/node/machinehash_test.go +++ b/internal/node/machinehash_test.go @@ -136,10 +136,9 @@ func createMachineSnapshot() (string, error) { func startDevnet() (*deps.DepsContainers, error) { container, err := deps.Run(context.Background(), deps.DepsConfig{ Devnet: &deps.DevnetConfig{ - DockerImage: deps.DefaultDevnetDockerImage, - BlockTime: deps.DefaultDevnetBlockTime, - BlockToWaitForOnStartup: deps.DefaultDevnetBlockToWaitForOnStartup, - Port: testutil.GetCartesiTestDepsPortRange(), + DockerImage: deps.DefaultDevnetDockerImage, + BlockTime: deps.DefaultDevnetBlockTime, + Port: testutil.GetCartesiTestDepsPortRange(), }, }) if err != nil {