From b608fca447e5547ceb03517c10e0dec28bd65a0d Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 3 Aug 2018 13:27:35 -0700 Subject: [PATCH 1/3] htlcswitch/circuit_test: use CircuitKey field names --- htlcswitch/circuit_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htlcswitch/circuit_test.go b/htlcswitch/circuit_test.go index 8ffc2efa..046c9fde 100644 --- a/htlcswitch/circuit_test.go +++ b/htlcswitch/circuit_test.go @@ -227,7 +227,10 @@ func TestCircuitMapPersistence(t *testing.T) { cfg, circuitMap := newCircuitMap(t) - circuit := circuitMap.LookupCircuit(htlcswitch.CircuitKey{chan1, 0}) + circuit := circuitMap.LookupCircuit(htlcswitch.CircuitKey{ + ChanID: chan1, + HtlcID: 0, + }) if circuit != nil { t.Fatalf("LookupByHTLC returned a circuit before any were added: %v", circuit) From a76b9a86cd3dc7685f9cefaed7de22482267f4e2 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 3 Aug 2018 13:28:02 -0700 Subject: [PATCH 2/3] routing/chainview/interface_test: use EdgePoint field names --- routing/chainview/interface_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/routing/chainview/interface_test.go b/routing/chainview/interface_test.go index bb8ef1af..63e54c5f 100644 --- a/routing/chainview/interface_test.go +++ b/routing/chainview/interface_test.go @@ -241,8 +241,8 @@ func testFilterBlockNotifications(node *rpctest.Harness, // Now we'll add both outpoints to the current filter. filter := []channeldb.EdgePoint{ - {targetScript, *outPoint1}, - {targetScript, *outPoint2}, + {FundingPkScript: targetScript, OutPoint: *outPoint1}, + {FundingPkScript: targetScript, OutPoint: *outPoint2}, } err = chainView.UpdateFilter(filter, uint32(currentHeight)) if err != nil { @@ -387,7 +387,7 @@ func testUpdateFilterBackTrack(node *rpctest.Harness, // After the block has been mined+notified we'll update the filter with // a _prior_ height so a "rewind" occurs. filter := []channeldb.EdgePoint{ - {testScript, *outPoint}, + {FundingPkScript: testScript, OutPoint: *outPoint}, } err = chainView.UpdateFilter(filter, uint32(currentHeight)) if err != nil { @@ -502,8 +502,8 @@ func testFilterSingleBlock(node *rpctest.Harness, chainView FilteredChainView, // Now we'll manually trigger filtering the block generated above. // First, we'll add the two outpoints to our filter. filter := []channeldb.EdgePoint{ - {testScript, *outPoint1}, - {testScript, *outPoint2}, + {FundingPkScript: testScript, OutPoint: *outPoint1}, + {FundingPkScript: testScript, OutPoint: *outPoint2}, } err = chainView.UpdateFilter(filter, uint32(currentHeight)) if err != nil { From fab87e5880053676c3e58f5e8414ccc2cc7ed0f2 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 3 Aug 2018 13:28:16 -0700 Subject: [PATCH 3/3] Makefile: switch to gometalinter.v2 --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 28406f2a..f3471cf5 100644 --- a/Makefile +++ b/Makefile @@ -5,14 +5,14 @@ DEP_PKG := github.com/golang/dep/cmd/dep BTCD_PKG := github.com/btcsuite/btcd GLIDE_PKG := github.com/Masterminds/glide GOVERALLS_PKG := github.com/mattn/goveralls -LINT_PKG := gopkg.in/alecthomas/gometalinter.v1 +LINT_PKG := gopkg.in/alecthomas/gometalinter.v2 GO_BIN := ${GOPATH}/bin DEP_BIN := $(GO_BIN)/dep BTCD_BIN := $(GO_BIN)/btcd GLIDE_BIN := $(GO_BIN)/glide GOVERALLS_BIN := $(GO_BIN)/goveralls -LINT_BIN := $(GO_BIN)/gometalinter.v1 +LINT_BIN := $(GO_BIN)/gometalinter.v2 HAVE_DEP := $(shell command -v $(DEP_BIN) 2> /dev/null) HAVE_BTCD := $(shell command -v $(BTCD_BIN) 2> /dev/null) @@ -100,7 +100,7 @@ $(GOVERALLS_BIN): go get -u $(GOVERALLS_PKG) $(LINT_BIN): - @$(call print, "Fetching gometalinter.v1") + @$(call print, "Fetching gometalinter.v2") go get -u $(LINT_PKG) $(GOINSTALL) $(LINT_PKG) @@ -178,13 +178,13 @@ flake-unit: # ====== ifeq ($(RACE), false) -travis: lint scratch itest unit-cover $(GOVERALLS_BIN) +travis: dep lint build itest unit-cover $(GOVERALLS_BIN) @$(call print, "Sending coverage report.") $(GOVERALLS_BIN) -coverprofile=profile.cov -service=travis-ci endif ifeq ($(RACE), true) -travis: lint dep btcd unit-race +travis: dep lint btcd unit-race endif