InvoiceEntity blob should not be indented when saved into DB

This commit is contained in:
nicolas.dorier 2020-08-25 14:53:01 +09:00
parent e7ea8ac40f
commit 8239fd7e0e
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -12,13 +12,19 @@ using DBriize;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using NBitcoin;
using Newtonsoft.Json;
using Encoders = NBitcoin.DataEncoders.Encoders;
namespace BTCPayServer.Services.Invoices
{
public class InvoiceRepository : IDisposable
{
static JsonSerializerSettings DefaultSerializerSettings;
static InvoiceRepository()
{
DefaultSerializerSettings = new JsonSerializerSettings();
NBitcoin.JsonConverters.Serializer.RegisterFrontConverters(DefaultSerializerSettings);
}
private readonly DBriizeEngine _Engine;
public DBriizeEngine Engine
@ -746,7 +752,7 @@ retry:
{
if (network == null)
{
return NBitcoin.JsonConverters.Serializer.ToString(data, null);
return JsonConvert.SerializeObject(data, DefaultSerializerSettings);
}
return network.ToString(data);
}