trust-chain 0.1.1.1 → 0.1.1.2
raw patch · 2 files changed
+19/−4 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.TrustChain: instance (GHC.Classes.Eq a, forall a1. GHC.Classes.Eq a1 => GHC.Classes.Eq (f a1)) => GHC.Classes.Eq (Data.TrustChain.TrustChain f a)
+ Data.TrustChain: instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.TrustChain.TrustChain f a)
+ Data.TrustChain: instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.TrustChain.TrustChain f a)
- Data.TrustChain: mkTrustProxy :: (Traversable f, Binary a, forall a. Binary a => Binary (f a), forall a. Monoid (f a), Applicative f) => PrivateKey -> f (TrustChain f a) -> IO (TrustChain f a)
+ Data.TrustChain: mkTrustProxy :: (Traversable f, Binary a, Binary (f a), Binary (f (TrustChain f a)), forall a. Monoid (f a)) => PrivateKey -> f (TrustChain f a) -> IO (TrustChain f a)
Files
- src/Data/TrustChain.hs +18/−3
- trust-chain.cabal +1/−1
src/Data/TrustChain.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE DerivingStrategies #-}@@ -66,9 +67,23 @@ deriving instance (Show a, forall a. Show a => Show (f a)) => Show (TrustChain f a) deriving instance (Read a, forall a. Read a => Read (f a)) => Read (TrustChain f a)-deriving instance (Eq a, forall a. Eq a => Eq (f a)) => Eq (TrustChain f a) deriving instance (Binary a, forall a. Binary a => Binary (f a)) => Binary (TrustChain f a) +instance Eq a => Eq (TrustChain f a) where+ Trustless a == Trustless a' = a == a'+ Trustless _ == TrustProxy _ = False+ TrustProxy _ == Trustless _ = False+ TrustProxy s == TrustProxy s' = signature s == signature s' && signedBy s == signedBy s' && signedEncoded s == signedEncoded s'++instance Ord a => Ord (TrustChain f a) where+ compare (Trustless a) (Trustless a') = compare a a'+ compare (Trustless a) _ = GT+ compare (TrustProxy a) (Trustless _) = LT+ compare (TrustProxy s) (TrustProxy s') =+ compare (signature s) (signature s')+ <> compare (signedBy s) (signedBy s')+ <> compare (signedEncoded s) (signedEncoded s')+ -- | A set of 'PublicKey's we accept information from. newtype Whitelist = Whitelist { unWhitelist :: Set PublicKey } deriving (Eq, Ord, Show, Read, Generic, Typeable, Binary)@@ -90,9 +105,9 @@ mkTrustProxy :: ( Traversable f , Binary a- , forall a. Binary a => Binary (f a)+ , Binary (f a)+ , Binary (f (TrustChain f a)) , forall a. Monoid (f a)- , Applicative f ) => PrivateKey -> f (TrustChain f a)
trust-chain.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: trust-chain-version: 0.1.1.1+version: 0.1.1.2 category: Cryptography, Crypto synopsis: An implementation of a trust chain license: MIT