summaryrefslogtreecommitdiff
path: root/ToxAddress.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-08-31 23:45:35 -0400
committerjoe <joe@jerkface.net>2017-08-31 23:45:35 -0400
commitf198e2b07a53603fa854b3a74702948493525613 (patch)
tree2db550e190cbd6b2ffc4ac8459afe065bc42a737 /ToxAddress.hs
parent1f8782c9efbe5ebe384cfe892b29d7822d704283 (diff)
Miscelaneous exports and TODO: Bits NodeId
Diffstat (limited to 'ToxAddress.hs')
-rw-r--r--ToxAddress.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/ToxAddress.hs b/ToxAddress.hs
index 9aa7a575..f0d4aba3 100644
--- a/ToxAddress.hs
+++ b/ToxAddress.hs
@@ -41,6 +41,7 @@ import Network.Address hiding (nodePort)
41import System.IO.Unsafe (unsafeDupablePerformIO) 41import System.IO.Unsafe (unsafeDupablePerformIO)
42import qualified Text.ParserCombinators.ReadP as RP 42import qualified Text.ParserCombinators.ReadP as RP
43import Text.Read 43import Text.Read
44import Data.Bits
44 45
45-- | perform io for hashes that do allocation and ffi. 46-- | perform io for hashes that do allocation and ffi.
46-- unsafeDupablePerformIO is used when possible as the 47-- unsafeDupablePerformIO is used when possible as the
@@ -85,6 +86,11 @@ instance S.Serialize NodeId where
85 get = NodeId . throwCryptoError . publicKey <$> S.getBytes 32 86 get = NodeId . throwCryptoError . publicKey <$> S.getBytes 32
86 put (NodeId bs) = S.putByteString $ BA.convert bs 87 put (NodeId bs) = S.putByteString $ BA.convert bs
87 88
89instance Bits NodeId where -- TODO
90
91instance FiniteBits NodeId where
92 finiteBitSize _ = 256
93
88data NodeInfo = NodeInfo 94data NodeInfo = NodeInfo
89 { nodeId :: NodeId 95 { nodeId :: NodeId
90 , nodeIP :: IP 96 , nodeIP :: IP