mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 01:43:50 +01:00
Remove references to cryptoCode in SyncStatus (#6275)
This commit is contained in:
parent
5190c25be0
commit
2e114d7c29
@ -12,7 +12,7 @@ namespace BTCPayServer.Abstractions.Contracts
|
||||
|
||||
public interface ISyncStatus
|
||||
{
|
||||
public string CryptoCode { get; set; }
|
||||
public string PaymentMethodId { get; set; }
|
||||
public bool Available { get; }
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ namespace BTCPayServer.Client.Models
|
||||
|
||||
public class SyncStatus
|
||||
{
|
||||
public string CryptoCode { get; set; }
|
||||
public string PaymentMethodId { get; set; }
|
||||
public virtual bool Available { get; set; }
|
||||
}
|
||||
|
||||
|
@ -1979,7 +1979,7 @@ namespace BTCPayServer.Tests
|
||||
Assert.Contains("BTC-CHAIN", serverInfoData.SupportedPaymentMethods);
|
||||
Assert.Contains("BTC-LN", serverInfoData.SupportedPaymentMethods);
|
||||
Assert.NotNull(serverInfoData.SyncStatus);
|
||||
Assert.Single(serverInfoData.SyncStatus.Select(s => s.CryptoCode == "BTC"));
|
||||
Assert.Single(serverInfoData.SyncStatus.Select(s => s.PaymentMethodId == "BTC-CHAIN"));
|
||||
}
|
||||
|
||||
[Fact(Timeout = TestTimeout)]
|
||||
|
@ -2,6 +2,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Client.Models;
|
||||
using BTCPayServer.Payments;
|
||||
|
||||
namespace BTCPayServer.Services.Altcoins.Monero.Services
|
||||
{
|
||||
@ -24,13 +25,18 @@ namespace BTCPayServer.Services.Altcoins.Monero.Services
|
||||
{
|
||||
return _moneroRpcProvider.Summaries.Select(pair => new MoneroSyncStatus()
|
||||
{
|
||||
Summary = pair.Value, CryptoCode = pair.Key
|
||||
Summary = pair.Value, PaymentMethodId = PaymentMethodId.Parse(pair.Key)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class MoneroSyncStatus: SyncStatus, ISyncStatus
|
||||
{
|
||||
public new PaymentMethodId PaymentMethodId
|
||||
{
|
||||
get => PaymentMethodId.Parse(base.PaymentMethodId);
|
||||
set => base.PaymentMethodId = value.ToString();
|
||||
}
|
||||
public override bool Available
|
||||
{
|
||||
get
|
||||
|
@ -2,6 +2,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Client.Models;
|
||||
using BTCPayServer.Payments;
|
||||
|
||||
namespace BTCPayServer.Services.Altcoins.Zcash.Services
|
||||
{
|
||||
@ -24,13 +25,18 @@ namespace BTCPayServer.Services.Altcoins.Zcash.Services
|
||||
{
|
||||
return _ZcashRpcProvider.Summaries.Select(pair => new ZcashSyncStatus()
|
||||
{
|
||||
Summary = pair.Value, CryptoCode = pair.Key
|
||||
Summary = pair.Value, PaymentMethodId = PaymentMethodId.Parse(pair.Key)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class ZcashSyncStatus: SyncStatus, ISyncStatus
|
||||
{
|
||||
public new PaymentMethodId PaymentMethodId
|
||||
{
|
||||
get => PaymentMethodId.Parse(base.PaymentMethodId);
|
||||
set => base.PaymentMethodId = value.ToString();
|
||||
}
|
||||
public override bool Available
|
||||
{
|
||||
get
|
||||
|
@ -3,6 +3,7 @@ using System.Linq;
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Client.Models;
|
||||
using BTCPayServer.HostedServices;
|
||||
using BTCPayServer.Payments;
|
||||
using NBXplorer.Models;
|
||||
|
||||
namespace BTCPayServer.Services
|
||||
@ -28,7 +29,7 @@ namespace BTCPayServer.Services
|
||||
.Where(summary => summary.Network.ShowSyncSummary)
|
||||
.Select(summary => new ServerInfoSyncStatusData2
|
||||
{
|
||||
CryptoCode = summary.Network.CryptoCode,
|
||||
PaymentMethodId = PaymentTypes.CHAIN.GetPaymentMethodId(summary.Network.CryptoCode).ToString(),
|
||||
NodeInformation = summary.Status.BitcoinStatus is BitcoinStatus s ? new ServerInfoNodeData()
|
||||
{
|
||||
Headers = s.Headers,
|
||||
|
@ -143,10 +143,8 @@
|
||||
"type": "object",
|
||||
"description": "Detailed sync status",
|
||||
"properties": {
|
||||
"cryptoCode": {
|
||||
"type": "string",
|
||||
"description": "The CryptoCode of the crypto currency (eg. BTC)",
|
||||
"example": "BTC"
|
||||
"paymentMethodId": {
|
||||
"$ref": "#/components/schemas/PaymentMethodId"
|
||||
},
|
||||
"nodeInformation": {
|
||||
"$ref": "#/components/schemas/ApplicationServerInfoNodeStatusData"
|
||||
|
Loading…
Reference in New Issue
Block a user