mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 13:26:47 +01:00
Improve error messages for on-chain related greenfield operations (#6393)
* Improve error messages for on-chain related greenfield operations * Fix test
This commit is contained in:
parent
796d8d4406
commit
894f68f2ae
@ -345,7 +345,7 @@ retry:
|
||||
var fetcher = new RateFetcher(factory);
|
||||
|
||||
Assert.True(RateRules.TryParse("X_X=kraken(X_BTC) * kraken(BTC_X)", out var rule));
|
||||
foreach (var pair in new[] { "DOGE_USD", "DOGE_CAD", "DASH_CAD", "DASH_USD", "DASH_EUR" })
|
||||
foreach (var pair in new[] { "DOGE_USD", "DOGE_CAD" })
|
||||
{
|
||||
var result = fetcher.FetchRate(CurrencyPair.Parse(pair), rule, null, default).GetAwaiter().GetResult();
|
||||
Assert.NotNull(result.BidAsk);
|
||||
|
@ -379,7 +379,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
if (network.ReadonlyWallet)
|
||||
{
|
||||
return this.CreateAPIError(503, "not-available",
|
||||
$"{network.CryptoCode} sending services are not currently available");
|
||||
$"This network only support read-only features");
|
||||
}
|
||||
|
||||
//This API is only meant for hot wallet usage for now. We can expand later when we allow PSBT manipulation.
|
||||
@ -573,8 +573,11 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
WellknownMetadataKeys.MasterHDKey);
|
||||
if (!derivationScheme.IsHotWallet || signingKeyStr is null)
|
||||
{
|
||||
return this.CreateAPIError(503, "not-available",
|
||||
$"{network.CryptoCode} sending services are not currently available");
|
||||
var reason = !derivationScheme.IsHotWallet ?
|
||||
"You cannot send from a cold wallet" :
|
||||
"NBXplorer doesn't have the seed of the wallet";
|
||||
|
||||
return this.CreateAPIError(503, "not-available", reason);
|
||||
}
|
||||
|
||||
var signingKey = ExtKey.Parse(signingKeyStr, network.NBitcoinNetwork);
|
||||
|
Loading…
Reference in New Issue
Block a user