From ece305123701ef48e4cb43d4d364029c873b9407 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Thu, 20 Sep 2018 03:31:20 -0700 Subject: [PATCH] htlcswitch/hodl: switch from debug tag to dev --- htlcswitch/hodl/{config_debug.go => config_dev.go} | 4 ++-- htlcswitch/hodl/{config_production.go => config_prod.go} | 2 +- htlcswitch/hodl/{mask_debug.go => mask_dev.go} | 5 +---- htlcswitch/hodl/{mask_production.go => mask_prod.go} | 5 +---- htlcswitch/hodl/mask_test.go | 5 +++-- 5 files changed, 8 insertions(+), 13 deletions(-) rename htlcswitch/hodl/{config_debug.go => config_dev.go} (96%) rename htlcswitch/hodl/{config_production.go => config_prod.go} (92%) rename htlcswitch/hodl/{mask_debug.go => mask_dev.go} (89%) rename htlcswitch/hodl/{mask_production.go => mask_prod.go} (78%) diff --git a/htlcswitch/hodl/config_debug.go b/htlcswitch/hodl/config_dev.go similarity index 96% rename from htlcswitch/hodl/config_debug.go rename to htlcswitch/hodl/config_dev.go index 957eb50d..ef8389ad 100644 --- a/htlcswitch/hodl/config_debug.go +++ b/htlcswitch/hodl/config_dev.go @@ -1,4 +1,4 @@ -// +build debug +// +build dev package hodl @@ -61,7 +61,7 @@ func (c *Config) Mask() Mask { } // NOTE: The value returned here will only honor the configuration if - // the debug build flag is present. In production, this method always + // the dev build flag is present. In production, this method always // returns hodl.MaskNone and Active(*) always returns false. return MaskFromFlags(flags...) } diff --git a/htlcswitch/hodl/config_production.go b/htlcswitch/hodl/config_prod.go similarity index 92% rename from htlcswitch/hodl/config_production.go rename to htlcswitch/hodl/config_prod.go index 8daeefd8..c5e9e934 100644 --- a/htlcswitch/hodl/config_production.go +++ b/htlcswitch/hodl/config_prod.go @@ -1,4 +1,4 @@ -// +build !debug +// +build !dev package hodl diff --git a/htlcswitch/hodl/mask_debug.go b/htlcswitch/hodl/mask_dev.go similarity index 89% rename from htlcswitch/hodl/mask_debug.go rename to htlcswitch/hodl/mask_dev.go index 5d5fd065..a1d50ff0 100644 --- a/htlcswitch/hodl/mask_debug.go +++ b/htlcswitch/hodl/mask_dev.go @@ -1,4 +1,4 @@ -// +build debug +// +build dev package hodl @@ -7,9 +7,6 @@ import ( "strings" ) -// DebugBuild signals that this is a debug build. -const DebugBuild = true - // MaskFromFlags merges a variadic set of Flags into a single Mask. func MaskFromFlags(flags ...Flag) Mask { var mask Mask diff --git a/htlcswitch/hodl/mask_production.go b/htlcswitch/hodl/mask_prod.go similarity index 78% rename from htlcswitch/hodl/mask_production.go rename to htlcswitch/hodl/mask_prod.go index c2db04ef..1b8a4b70 100644 --- a/htlcswitch/hodl/mask_production.go +++ b/htlcswitch/hodl/mask_prod.go @@ -1,10 +1,7 @@ -// +build !debug +// +build !dev package hodl -// DebugBuild signals that this is a production build. -const DebugBuild = false - // MaskFromFlags in production always returns MaskNone. func MaskFromFlags(_ ...Flag) Mask { return MaskNone diff --git a/htlcswitch/hodl/mask_test.go b/htlcswitch/hodl/mask_test.go index cf29d19b..07ba6e33 100644 --- a/htlcswitch/hodl/mask_test.go +++ b/htlcswitch/hodl/mask_test.go @@ -3,6 +3,7 @@ package hodl_test import ( "testing" + "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/htlcswitch/hodl" ) @@ -87,8 +88,8 @@ var hodlMaskTests = []struct { // correctly reports active for flags in the tests' expected flags, and inactive // for all others. func TestMask(t *testing.T) { - if !hodl.DebugBuild { - t.Fatalf("htlcswitch tests must be run with '-tags debug'") + if !build.IsDevBuild() { + t.Fatalf("htlcswitch tests must be run with '-tags=dev'") } for i, test := range hodlMaskTests {