Skip to content

Commit

Permalink
chore(deps): Remove Devnet 'BlockToWaitForOnStartup' as it is no long…
Browse files Browse the repository at this point in the history
…er needed
  • Loading branch information
fmoura committed Aug 29, 2024
1 parent bd3b5a0 commit ba0c267
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
25 changes: 11 additions & 14 deletions internal/deps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -63,7 +62,6 @@ type DevnetConfig struct {
Port string
BlockTime string
BlockFinalizationOffset string
BlockToWaitForOnStartup string
NoMining bool
}

Expand All @@ -80,7 +78,6 @@ func NewDefaultDepsConfig() *DepsConfig {
DefaultDevnetPort,
DefaultDevnetBlockTime,
DefaultSlotsInAnEpoch,
DefaultDevnetBlockToWaitForOnStartup,
DefaultDevnetNoMining,
},
}
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions internal/node/machinehash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ba0c267

Please sign in to comment.