From f3f39e760ac1a3df23042dba619ac5d04ad353ad Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sun, 10 May 2020 09:50:09 +0100 Subject: [PATCH] refine definition of Subscribe to prevent subscription in None and Disabled states --- definitions/src/Simplex/Messaging/Protocol.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/definitions/src/Simplex/Messaging/Protocol.hs b/definitions/src/Simplex/Messaging/Protocol.hs index 662ea62821..ec73b61957 100644 --- a/definitions/src/Simplex/Messaging/Protocol.hs +++ b/definitions/src/Simplex/Messaging/Protocol.hs @@ -134,7 +134,15 @@ data Command res (from :: Participant) (to :: Participant) state state' :: Type ('None <==> 'None <==| s) ('New <==> 'New <==| s) - Subscribe :: Command () 'Recipient 'Broker state state -- TODO + Subscribe :: ( (r == 'None) ~ 'False + , (r == 'Disabled) ~ 'False + , (b == 'None) ~ 'False + , (b == 'Disabled) ~ 'False + , Prf HasState 'Sender s ) + => Command () + 'Recipient 'Broker + (r <==> b <==| s) + (r <==> b <==| s) SendInvite :: Prf HasState 'Broker s => String -- invitation - TODO