diff options
author | joe <joe@jerkface.net> | 2017-08-31 23:45:35 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-08-31 23:45:35 -0400 |
commit | f198e2b07a53603fa854b3a74702948493525613 (patch) | |
tree | 2db550e190cbd6b2ffc4ac8459afe065bc42a737 /ToxAddress.hs | |
parent | 1f8782c9efbe5ebe384cfe892b29d7822d704283 (diff) |
Miscelaneous exports and TODO: Bits NodeId
Diffstat (limited to 'ToxAddress.hs')
-rw-r--r-- | ToxAddress.hs | 6 |
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) | |||
41 | import System.IO.Unsafe (unsafeDupablePerformIO) | 41 | import System.IO.Unsafe (unsafeDupablePerformIO) |
42 | import qualified Text.ParserCombinators.ReadP as RP | 42 | import qualified Text.ParserCombinators.ReadP as RP |
43 | import Text.Read | 43 | import Text.Read |
44 | import 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 | ||
89 | instance Bits NodeId where -- TODO | ||
90 | |||
91 | instance FiniteBits NodeId where | ||
92 | finiteBitSize _ = 256 | ||
93 | |||
88 | data NodeInfo = NodeInfo | 94 | data NodeInfo = NodeInfo |
89 | { nodeId :: NodeId | 95 | { nodeId :: NodeId |
90 | , nodeIP :: IP | 96 | , nodeIP :: IP |