From 2505e80283ea030d7616176fd9f30e9ced3e0594 Mon Sep 17 00:00:00 2001 From: araspitzu Date: Wed, 27 Mar 2019 15:49:22 +0100 Subject: [PATCH 1/2] Factor out nodeId API param, rename /channels API param to nodeId. (#919) --- .../src/main/scala/fr/acinq/eclair/api/Service.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/eclair-core/src/main/scala/fr/acinq/eclair/api/Service.scala b/eclair-core/src/main/scala/fr/acinq/eclair/api/Service.scala index 1674096fb..f0d36f74b 100644 --- a/eclair-core/src/main/scala/fr/acinq/eclair/api/Service.scala +++ b/eclair-core/src/main/scala/fr/acinq/eclair/api/Service.scala @@ -41,6 +41,7 @@ trait Service extends Directives with Logging { // a named and typed URL parameter used across several routes, 32-bytes hex-encoded val channelId = "channelId".as[ByteVector32](sha256HashUnmarshaller) + val nodeId = "nodeId".as[PublicKey] val shortChannelId = "shortChannelId".as[ShortChannelId](shortChannelIdUnmarshaller) val apiExceptionHandler = ExceptionHandler { @@ -101,12 +102,12 @@ trait Service extends Directives with Logging { path("connect") { formFields("uri".as[String]) { uri => complete(eclairApi.connect(uri)) - } ~ formFields("nodeId".as[PublicKey], "host".as[String], "port".as[Int].?) { (nodeId, host, port_opt) => + } ~ formFields(nodeId, "host".as[String], "port".as[Int].?) { (nodeId, host, port_opt) => complete(eclairApi.connect(s"$nodeId@$host:${port_opt.getOrElse(NodeURI.DEFAULT_PORT)}")) } } ~ path("open") { - formFields("nodeId".as[PublicKey], "fundingSatoshis".as[Long], "pushMsat".as[Long].?, "fundingFeerateSatByte".as[Long].?, "channelFlags".as[Int].?) { + formFields(nodeId, "fundingSatoshis".as[Long], "pushMsat".as[Long].?, "fundingFeerateSatByte".as[Long].?, "channelFlags".as[Int].?) { (nodeId, fundingSatoshis, pushMsat, fundingFeerateSatByte, channelFlags) => complete(eclairApi.open(nodeId, fundingSatoshis, pushMsat, fundingFeerateSatByte, channelFlags)) } @@ -134,7 +135,7 @@ trait Service extends Directives with Logging { complete(eclairApi.peersInfo()) } ~ path("channels") { - formFields("toRemoteNodeId".as[PublicKey].?) { toRemoteNodeId_opt => + formFields(nodeId.?) { toRemoteNodeId_opt => complete(eclairApi.channelsInfo(toRemoteNodeId_opt)) } } ~ @@ -150,7 +151,7 @@ trait Service extends Directives with Logging { complete(eclairApi.allchannels()) } ~ path("allupdates") { - formFields("nodeId".as[PublicKey].?) { nodeId_opt => + formFields(nodeId.?) { nodeId_opt => complete(eclairApi.allupdates(nodeId_opt)) } } ~ @@ -171,7 +172,7 @@ trait Service extends Directives with Logging { case _ => reject(MalformedFormFieldRejection("invoice", "The invoice must have an amount or you need to specify one using 'amountMsat'")) } } ~ path("findroutetonode") { - formFields("nodeId".as[PublicKey], "amountMsat".as[Long]) { (nodeId, amount) => + formFields(nodeId, "amountMsat".as[Long]) { (nodeId, amount) => complete(eclairApi.findRoute(nodeId, amount)) } } ~ From e2ff5c857be819cee688682203bde6cd8ac4d643 Mon Sep 17 00:00:00 2001 From: Fabrice Drouin Date: Thu, 28 Mar 2019 09:49:17 +0100 Subject: [PATCH 2/2] Set version to 0.3-SNAPSHOT (#920) We have enough major changes from the last release to justify switching to 0.3 --- eclair-core/pom.xml | 2 +- eclair-node-gui/pom.xml | 2 +- eclair-node/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eclair-core/pom.xml b/eclair-core/pom.xml index 22d61f6c7..e2541f1a0 100644 --- a/eclair-core/pom.xml +++ b/eclair-core/pom.xml @@ -21,7 +21,7 @@ fr.acinq.eclair eclair_2.11 - 0.2-SNAPSHOT + 0.3-SNAPSHOT eclair-core_2.11 diff --git a/eclair-node-gui/pom.xml b/eclair-node-gui/pom.xml index 36aeee7d9..387136884 100644 --- a/eclair-node-gui/pom.xml +++ b/eclair-node-gui/pom.xml @@ -21,7 +21,7 @@ fr.acinq.eclair eclair_2.11 - 0.2-SNAPSHOT + 0.3-SNAPSHOT eclair-node-gui_2.11 diff --git a/eclair-node/pom.xml b/eclair-node/pom.xml index 36c687f81..1cdd3cbbf 100644 --- a/eclair-node/pom.xml +++ b/eclair-node/pom.xml @@ -21,7 +21,7 @@ fr.acinq.eclair eclair_2.11 - 0.2-SNAPSHOT + 0.3-SNAPSHOT eclair-node_2.11 diff --git a/pom.xml b/pom.xml index 496aef988..de1bf1b41 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ fr.acinq.eclair eclair_2.11 - 0.2-SNAPSHOT + 0.3-SNAPSHOT pom