summaryrefslogtreecommitdiffhomepage
path: root/Hash.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-26 16:15:43 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-26 16:18:01 -0400
commit52f9c68869fa8956db55980f0b36ba817f825ffb (patch)
treeb288b73ee5766a0048b1e2d593a0d0ec130044c0 /Hash.hs
parent62f7653e39e95d3e9cd308810e487e3cdee84d52 (diff)
downloaddebug-me-52f9c68869fa8956db55980f0b36ba817f825ffb.tar.gz
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.
Diffstat (limited to 'Hash.hs')
-rw-r--r--Hash.hs7
1 files changed, 5 insertions, 2 deletions
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)