summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-01-20 20:27:12 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-01-20 20:27:12 +0100
commit10d31811ab0f3924416c078f1a359c70f0e58143 (patch)
tree7498c9d0dadd93217a8d3178d56f9703e178819e
parentfd1bc61ee1c6273c1114c7b605043ec1c7f6bf32 (diff)
Identity: filter ancestors
-rw-r--r--src/Identity.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Identity.hs b/src/Identity.hs
index effa9e0..0f3e81b 100644
--- a/src/Identity.hs
+++ b/src/Identity.hs
@@ -113,7 +113,7 @@ validateIdentity = validateIdentityF . I.Identity
validateIdentityF :: Foldable m => m (Stored (Signed IdentityData)) -> Maybe (Identity m)
validateIdentityF mdata = do
- let idata = toList mdata -- TODO: eliminate ancestors
+ let idata = filterAncestors $ toList mdata
guard $ not $ null idata
mapM_ verifySignatures $ gatherPrevious S.empty idata
Identity
@@ -209,7 +209,7 @@ updateIdentity = updateIdentitySets . map (\u -> (u, ancestors [u]))
updateOwners :: [Stored (Signed IdentityData)] -> Identity m -> Identity m
updateOwners updates orig@Identity { idOwner_ = Just owner, idUpdates_ = cupdates } =
- orig { idOwner_ = Just $ updateIdentity updates owner, idUpdates_ = updates ++ cupdates {- TODO: eliminate ancestors -} }
+ orig { idOwner_ = Just $ updateIdentity updates owner, idUpdates_ = filterAncestors (updates ++ cupdates) }
updateOwners _ orig@Identity { idOwner_ = Nothing } = orig
sameIdentity :: (Foldable m, Foldable m') => Identity m -> Identity m' -> Bool