From 2931b2d3b2e071c46ed4bdda3fb62037a1de0f0c Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Tue, 22 May 2018 15:49:38 -0400 Subject: [PATCH] lnwallet: add height hint cache to backend tests --- lnwallet/interface_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lnwallet/interface_test.go b/lnwallet/interface_test.go index d2ded0f3..2ca744c4 100644 --- a/lnwallet/interface_test.go +++ b/lnwallet/interface_test.go @@ -2068,7 +2068,19 @@ func TestLightningWallet(t *testing.T) { rpcConfig := miningNode.RPCConfig() - chainNotifier, err := btcdnotify.New(&rpcConfig) + tempDir, err := ioutil.TempDir("", "channeldb") + if err != nil { + t.Fatalf("unable to create temp dir: %v", err) + } + db, err := channeldb.Open(tempDir) + if err != nil { + t.Fatalf("unable to create db: %v", err) + } + hintCache, err := chainntnfs.NewHeightHintCache(db) + if err != nil { + t.Fatalf("unable to create height hint cache: %v", err) + } + chainNotifier, err := btcdnotify.New(&rpcConfig, hintCache, hintCache) if err != nil { t.Fatalf("unable to create notifier: %v", err) }