Browse Source

htlcswitch/hodl: switch from debug tag to dev

master
Conner Fromknecht 6 years ago
parent
commit
ece3051237
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7
  1. 4
      htlcswitch/hodl/config_dev.go
  2. 2
      htlcswitch/hodl/config_prod.go
  3. 5
      htlcswitch/hodl/mask_dev.go
  4. 5
      htlcswitch/hodl/mask_prod.go
  5. 5
      htlcswitch/hodl/mask_test.go

4
htlcswitch/hodl/config_debug.go → 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...)
}

2
htlcswitch/hodl/config_production.go → htlcswitch/hodl/config_prod.go

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

5
htlcswitch/hodl/mask_debug.go → 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

5
htlcswitch/hodl/mask_production.go → 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

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

Loading…
Cancel
Save