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