Skip to content

Commit

Permalink
build rofl: Fail if cannot connect to network
Browse files Browse the repository at this point in the history
The current behavior silently falls back to production builds when your
Localnet is not accessible. If --mode is auto, then it should fail, when
the connection cannot be established.
  • Loading branch information
matevz committed Sep 12, 2024
1 parent 21d81ca commit 98051cf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/rofl/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,10 @@ var (
case buildMode == buildModeAuto && !offline:
ctx := context.Background()
conn, err := connection.Connect(ctx, npa.Network)
if err != nil {
break // Autodetection failed.
}
cobra.CheckErr(err)

params, err := conn.Consensus().Registry().ConsensusParameters(ctx, consensus.HeightLatest)
if err != nil {
break // Autodetection failed.
}
cobra.CheckErr(err)

if params.DebugAllowTestRuntimes {
buildMode = buildModeUnsafe
Expand Down

0 comments on commit 98051cf

Please sign in to comment.