htlcswitch/hodl: switch from debug tag to dev

This commit is contained in:
Conner Fromknecht 2018-09-20 03:31:20 -07:00
parent 3403794e81
commit ece3051237
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7
5 changed files with 8 additions and 13 deletions

@ -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...)
}

@ -1,4 +1,4 @@
// +build !debug
// +build !dev
package hodl

@ -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

@ -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

@ -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 {