From 3469eb5110be2e12df7b4148ee606a7f47b4f9e8 Mon Sep 17 00:00:00 2001 From: Andrea Date: Thu, 22 Aug 2019 12:18:23 +0200 Subject: [PATCH] Do not reload the config in eclair-node, remove unnecessary line in api test --- eclair-node/src/main/scala/fr/acinq/eclair/Boot.scala | 2 +- .../src/test/scala/fr/acinq/eclair/api/ApiServiceSpec.scala | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/eclair-node/src/main/scala/fr/acinq/eclair/Boot.scala b/eclair-node/src/main/scala/fr/acinq/eclair/Boot.scala index 90d9ab6a24..543f3af5e4 100644 --- a/eclair-node/src/main/scala/fr/acinq/eclair/Boot.scala +++ b/eclair-node/src/main/scala/fr/acinq/eclair/Boot.scala @@ -45,7 +45,7 @@ object Boot extends App with Logging { setup.bootstrap onComplete { case Success(kit) => plugins.foreach(_.onKit(kit)) - val config = NodeParams.loadConfiguration(datadir, ConfigFactory.empty()) + val config = setup.config if(config.getBoolean("api.enabled")){ logger.info(s"json API enabled on port=${config.getInt("api.port")}") implicit val materializer = ActorMaterializer() diff --git a/eclair-node/src/test/scala/fr/acinq/eclair/api/ApiServiceSpec.scala b/eclair-node/src/test/scala/fr/acinq/eclair/api/ApiServiceSpec.scala index bfd9ce16a7..e1289f2624 100644 --- a/eclair-node/src/test/scala/fr/acinq/eclair/api/ApiServiceSpec.scala +++ b/eclair-node/src/test/scala/fr/acinq/eclair/api/ApiServiceSpec.scala @@ -141,12 +141,11 @@ class ApiServiceSpec extends FunSuite with ScalatestRouteTest with IdiomaticMock test("'usablebalances' asks router for current usable balances") { - val remoteNodeId = PublicKey(hex"03af0ed6052cf28d670665549bc86f4b721c9fdb309d40c58f5811f63966e005d0") val eclair = mock[Eclair] val mockService = new MockService(eclair) eclair.usableBalances()(any[Timeout]) returns Future.successful(List( - UsableBalances(canSend = MilliSatoshi(100000000), canReceive = MilliSatoshi(20000000), shortChannelId = ShortChannelId(1), remoteNodeId = remoteNodeId, isPublic = true), - UsableBalances(canSend = MilliSatoshi(400000000), canReceive = MilliSatoshi(30000000), shortChannelId = ShortChannelId(2), remoteNodeId = remoteNodeId, isPublic = false) + UsableBalances(canSend = MilliSatoshi(100000000), canReceive = MilliSatoshi(20000000), shortChannelId = ShortChannelId(1), remoteNodeId = aliceNodeId, isPublic = true), + UsableBalances(canSend = MilliSatoshi(400000000), canReceive = MilliSatoshi(30000000), shortChannelId = ShortChannelId(2), remoteNodeId = aliceNodeId, isPublic = false) )) Post("/usablebalances") ~>