From ae1f7348f01dcb038f558e86c903532ad0a72927 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 17 Dec 2019 15:01:36 +0100 Subject: [PATCH] lntest: fix macaroon paths This change makes sure that all macaroons are stored in the same folder. This makes it possible to use the lntest package in external projects that use loop's lndclient library which currently assumes that the admin macaroon and subserver macaroons are in the same sub folder of lnd's data directory. --- lntest/node.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lntest/node.go b/lntest/node.go index adb1b405..22fad610 100644 --- a/lntest/node.go +++ b/lntest/node.go @@ -298,9 +298,13 @@ func newNode(cfg NodeConfig) (*HarnessNode, error) { cfg.LogDir = filepath.Join(cfg.BaseDir, "log") cfg.TLSCertPath = filepath.Join(cfg.DataDir, "tls.cert") cfg.TLSKeyPath = filepath.Join(cfg.DataDir, "tls.key") - cfg.AdminMacPath = filepath.Join(cfg.DataDir, "admin.macaroon") - cfg.ReadMacPath = filepath.Join(cfg.DataDir, "readonly.macaroon") - cfg.InvoiceMacPath = filepath.Join(cfg.DataDir, "invoice.macaroon") + + networkDir := filepath.Join( + cfg.DataDir, "chain", "bitcoin", cfg.NetParams.Name, + ) + cfg.AdminMacPath = filepath.Join(networkDir, "admin.macaroon") + cfg.ReadMacPath = filepath.Join(networkDir, "readonly.macaroon") + cfg.InvoiceMacPath = filepath.Join(networkDir, "invoice.macaroon") cfg.P2PPort, cfg.RPCPort, cfg.RESTPort, cfg.ProfilePort = generateListeningPorts()