From 46b97601790d01fd2c1f7606fd0e8e4a64518eaf Mon Sep 17 00:00:00 2001 From: d11n Date: Tue, 31 May 2022 12:15:38 +0200 Subject: [PATCH] Greenfield: Fix GetDepositAddress return type (#3790) The local clients GetFromActionResult cannot handle the JValue return type, because it gets invoked with GetFromActionResult. --- .../GreenField/GreenfieldLightningNodeApiController.cs | 3 ++- BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldLightningNodeApiController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldLightningNodeApiController.cs index 315cca09a..2a4792c7d 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldLightningNodeApiController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldLightningNodeApiController.cs @@ -160,7 +160,8 @@ namespace BTCPayServer.Controllers.Greenfield public virtual async Task GetDepositAddress(string cryptoCode, CancellationToken cancellationToken = default) { var lightningClient = await GetLightningClient(cryptoCode, true); - return Ok(new JValue((await lightningClient.GetDepositAddress(cancellationToken)).ToString())); + var addr = await lightningClient.GetDepositAddress(cancellationToken); + return Ok(new JValue(addr.ToString())); } public virtual async Task GetPayment(string cryptoCode, string paymentHash, CancellationToken cancellationToken = default) diff --git a/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs b/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs index d462fe66c..68d3d40e5 100644 --- a/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs +++ b/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs @@ -601,6 +601,7 @@ namespace BTCPayServer.Controllers.Greenfield { JsonResult jsonResult => (T)jsonResult.Value, OkObjectResult { Value: T res } => res, + OkObjectResult { Value: JValue res } => res.Value(), _ => default }; }