mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-04-26 23:55:14 +00:00
lib: add JSON instance to Signature type (#1764)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
@@ -816,6 +816,13 @@ instance CryptoSignature (Signature s) => StrEncoding (Signature s) where
|
||||
strDecode = decodeSignature
|
||||
{-# INLINE strDecode #-}
|
||||
|
||||
instance CryptoSignature (Signature s) => ToJSON (Signature s) where
|
||||
toJSON = strToJSON
|
||||
toEncoding = strToJEncoding
|
||||
|
||||
instance CryptoSignature (Signature s) => FromJSON (Signature s) where
|
||||
parseJSON = strParseJSON "Signature"
|
||||
|
||||
instance CryptoSignature (Signature s) => Encoding (Signature s) where
|
||||
smpEncode = smpEncode . signatureBytes
|
||||
{-# INLINE smpEncode #-}
|
||||
|
||||
Reference in New Issue
Block a user