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

View File

@ -1,4 +1,4 @@
// +build debug // +build dev
package hodl package hodl
@ -61,7 +61,7 @@ func (c *Config) Mask() Mask {
} }
// NOTE: The value returned here will only honor the configuration if // 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. // returns hodl.MaskNone and Active(*) always returns false.
return MaskFromFlags(flags...) return MaskFromFlags(flags...)
} }

View File

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

View File

@ -1,4 +1,4 @@
// +build debug // +build dev
package hodl package hodl
@ -7,9 +7,6 @@ import (
"strings" "strings"
) )
// DebugBuild signals that this is a debug build.
const DebugBuild = true
// MaskFromFlags merges a variadic set of Flags into a single Mask. // MaskFromFlags merges a variadic set of Flags into a single Mask.
func MaskFromFlags(flags ...Flag) Mask { func MaskFromFlags(flags ...Flag) Mask {
var mask Mask var mask Mask

View File

@ -1,10 +1,7 @@
// +build !debug // +build !dev
package hodl package hodl
// DebugBuild signals that this is a production build.
const DebugBuild = false
// MaskFromFlags in production always returns MaskNone. // MaskFromFlags in production always returns MaskNone.
func MaskFromFlags(_ ...Flag) Mask { func MaskFromFlags(_ ...Flag) Mask {
return MaskNone return MaskNone

View File

@ -3,6 +3,7 @@ package hodl_test
import ( import (
"testing" "testing"
"github.com/lightningnetwork/lnd/build"
"github.com/lightningnetwork/lnd/htlcswitch/hodl" "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 // correctly reports active for flags in the tests' expected flags, and inactive
// for all others. // for all others.
func TestMask(t *testing.T) { func TestMask(t *testing.T) {
if !hodl.DebugBuild { if !build.IsDevBuild() {
t.Fatalf("htlcswitch tests must be run with '-tags debug'") t.Fatalf("htlcswitch tests must be run with '-tags=dev'")
} }
for i, test := range hodlMaskTests { for i, test := range hodlMaskTests {