summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2018-11-28 22:09:02 -0500
committerJoe Crayne <joe@jerkface.net>2018-12-16 14:08:26 -0500
commit92fce0499c05c609cba423ea02f5c61aa33c6915 (patch)
treec24d047d011c2c4c0b6bbd80f5ec16739b84baf2 /src
parente4bee438e49bd7eeab132f375398f9c6fe481c01 (diff)
getPublicKey should not throw.
Diffstat (limited to 'src')
-rw-r--r--src/Crypto/Tox.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Crypto/Tox.hs b/src/Crypto/Tox.hs
index bd4cdfba..d418f504 100644
--- a/src/Crypto/Tox.hs
+++ b/src/Crypto/Tox.hs
@@ -582,7 +582,8 @@ data TransportCrypto = TransportCrypto
582 } 582 }
583 583
584getPublicKey :: S.Get PublicKey 584getPublicKey :: S.Get PublicKey
585getPublicKey = throwCryptoError . publicKey <$> S.getBytes 32 585getPublicKey = eitherCryptoError . publicKey <$> S.getBytes 32
586 >>= either (fail . show) return
586 587
587putPublicKey :: PublicKey -> S.Put 588putPublicKey :: PublicKey -> S.Put
588putPublicKey bs = S.putByteString $ BA.convert bs 589putPublicKey bs = S.putByteString $ BA.convert bs