Switch  from  to
MODIFY
WalletWasabi/JsonConverters/EndPointJsonConverter.cs
WalletWasabi/JsonConverters/EndPointJsonConverter.cs
@@ -5,7 +5,7 @@ using WalletWasabi.Userfacing;
namespace WalletWasabi.JsonConverters
{
- public class EndPointJsonConverter : JsonConverter
+ public class EndPointJsonConverter : JsonConverter<EndPoint>
{
private EndPointJsonConverter()
{
@@ -24,13 +24,7 @@ namespace WalletWasabi.JsonConverters
public int DefaultPort { get; }
/// <inheritdoc />
- public override bool CanConvert(Type objectType)
- {
- return objectType == typeof(EndPoint);
- }
-
- /// <inheritdoc />
- public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ public override EndPoint? ReadJson(JsonReader reader, Type objectType, EndPoint? existingValue, bool hasExistingValue, JsonSerializer serializer)
{
var endPointString = reader.Value as string;
if (EndPointParser.TryParse(endPointString, DefaultPort, out EndPoint? endPoint))
@@ -44,7 +38,7 @@ namespace WalletWasabi.JsonConverters
}
/// <inheritdoc />
- public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ public override void WriteJson(JsonWriter writer, EndPoint? value, JsonSerializer serializer)
{
if (value is EndPoint endPoint)
{

Switch  from  to