From 98051cf4f0fb68c11a2b7240c5e39b70c1c39bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Jekovec?= Date: Thu, 12 Sep 2024 11:59:13 +0200 Subject: [PATCH] build rofl: Fail if cannot connect to network 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. --- cmd/rofl/build.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/rofl/build.go b/cmd/rofl/build.go index 0387fb9a..842635aa 100644 --- a/cmd/rofl/build.go +++ b/cmd/rofl/build.go @@ -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