From 561649a4981e48dba6c7d82183f1dd22b9524183 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 31 Oct 2022 17:09:01 +0000 Subject: [PATCH] add JSON instances for SwitchPhase (#552) --- src/Simplex/Messaging/Agent/Protocol.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Simplex/Messaging/Agent/Protocol.hs b/src/Simplex/Messaging/Agent/Protocol.hs index ebd118a6b..9b96ce573 100644 --- a/src/Simplex/Messaging/Agent/Protocol.hs +++ b/src/Simplex/Messaging/Agent/Protocol.hs @@ -360,6 +360,13 @@ instance StrEncoding SwitchPhase where "completed" -> pure SPCompleted _ -> fail "bad SwitchPhase" +instance ToJSON SwitchPhase where + toEncoding = strToJEncoding + toJSON = strToJSON + +instance FromJSON SwitchPhase where + parseJSON = strParseJSON "SwitchPhase" + data ConnectionStats = ConnectionStats { rcvServers :: [SMPServer], sndServers :: [SMPServer]