From 52f9c68869fa8956db55980f0b36ba817f825ffb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 26 Apr 2017 16:15:43 -0400 Subject: include elapsedTime in Activity Time is relative, so the debug-me proof chain doesn't prove when things happened, but it's still useful to have some idea of how long things took to happen. This makes --replay work with logs gotten by --download. Log still includes loggedTimestamp. This is a bit redundant, and is unused now, but it's useful for log files to record when messages were received. This commit was sponsored by Riku Voipio. --- Hash.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Hash.hs') diff --git a/Hash.hs b/Hash.hs index bef3ae0..c9b45e0 100644 --- a/Hash.hs +++ b/Hash.hs @@ -35,8 +35,8 @@ instance Hashable a => Hashable (Tagged a) where hash (Tagged b a) = hash [hash b, hash a] instance Hashable a => Hashable (Activity a) where - hash (Activity a mp s) = hash $ Tagged "Activity" - [hash a, hash mp, hash s] + hash (Activity a mp mt s) = hash $ Tagged "Activity" + [hash a, hash mp, hash mt, hash s] instance Hashable Entered where hash v = hash $ Tagged "Entered" @@ -62,6 +62,9 @@ instance Hashable PublicKey where instance Hashable GpgSig where hash (GpgSig v) = hash $ Tagged "GpgSig" v +instance Hashable ElapsedTime where + hash (ElapsedTime n) = hash $ Tagged "ElapsedTime" $ C8.pack $ show n + -- | Hash a list of hashes by hashing the concacenation of the hashes. instance Hashable [Hash] where hash = hash . B.concat . map (val . hashValue) -- cgit v1.2.3