mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Greenfield: Fix GetDepositAddress return type (#3790)
The local clients GetFromActionResult cannot handle the JValue return type, because it gets invoked with GetFromActionResult<string>.
This commit is contained in:
@@ -160,7 +160,8 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
public virtual async Task<IActionResult> 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<IActionResult> GetPayment(string cryptoCode, string paymentHash, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -601,6 +601,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
{
|
||||
JsonResult jsonResult => (T)jsonResult.Value,
|
||||
OkObjectResult { Value: T res } => res,
|
||||
OkObjectResult { Value: JValue res } => res.Value<T>(),
|
||||
_ => default
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user