diff options
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 |