summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--OnionTransport.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/OnionTransport.hs b/OnionTransport.hs
index ce1063d2..968e3e38 100644
--- a/OnionTransport.hs
+++ b/OnionTransport.hs
@@ -77,6 +77,11 @@ data OnionMessage (f :: * -> *)
77 | OnionToRoute PublicKey (Assym (f DataToRoute)) -- destination key, aliased Assym 77 | OnionToRoute PublicKey (Assym (f DataToRoute)) -- destination key, aliased Assym
78 | OnionToRouteResponse (Assym (f DataToRoute)) 78 | OnionToRouteResponse (Assym (f DataToRoute))
79 79
80deriving instance ( Show (f (AnnounceRequest, Nonce8))
81 , Show (f AnnounceResponse)
82 , Show (f DataToRoute)
83 ) => Show (OnionMessage f)
84
80data OnionToOwner = OnionToOwner NodeInfo (ReturnPath N3) 85data OnionToOwner = OnionToOwner NodeInfo (ReturnPath N3)
81 | OnionToMe SockAddr -- SockAddr is immediate peer in route 86 | OnionToMe SockAddr -- SockAddr is immediate peer in route
82 deriving Show 87 deriving Show
@@ -228,11 +233,12 @@ instance ( Serialize (ReturnPath n) ) => Serialize (OnionResponse n) where
228 233
229 234
230data Addressed a = Addressed { sockAddr :: SockAddr, unaddressed :: a } 235data Addressed a = Addressed { sockAddr :: SockAddr, unaddressed :: a }
236 deriving (Eq,Show)
231 237
232instance Sized a => Sized (Addressed a) where 238instance Sized a => Sized (Addressed a) where
233 size = case size of 239 size = case size :: Size a of
234 ConstSize n -> ConstSize $ 1{-family-} + 16{-ip-} + 2{-port-} + n 240 ConstSize n -> ConstSize $ 1{-family-} + 16{-ip-} + 2{-port-} + n
235 VarSize f -> VarSize $ \x -> 1{-family-} + 16{-ip-} + 2{-port-} + f x 241 VarSize f -> VarSize $ \x -> 1{-family-} + 16{-ip-} + 2{-port-} + f (unaddressed x)
236 242
237getForwardAddr :: S.Get SockAddr 243getForwardAddr :: S.Get SockAddr
238getForwardAddr = do 244getForwardAddr = do