Skip to content

Commit 537e7dd

Browse files
committed
Add more debug statements.
1 parent b88f1b1 commit 537e7dd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

eventsourcingdb/event/event.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,19 @@ def verify_hash(self) -> None:
110110
self.data_content_type,
111111
])
112112

113+
print("########### Metadata: ", metadata)
114+
113115
metadata_bytes = metadata.encode("utf-8")
114116
data_bytes = json.dumps(self.data).encode("utf-8")
115117

116118
metadata_hash = sha256(metadata_bytes).hexdigest()
117119
data_hash = sha256(data_bytes).hexdigest()
118120

119-
print("########### Metadata hash: ", metadata_hash)
120-
print("########### Data hash: ", data_hash)
121-
122121
final_hash = sha256()
123122
final_hash.update(metadata_hash.encode("utf-8"))
124123
final_hash.update(data_hash.encode("utf-8"))
125124
final_hash_hex = final_hash.hexdigest()
126125

127-
print("########### Final hash: ", final_hash_hex)
128-
print("########### Event hash: ", self.hash)
129-
130126
if final_hash_hex != self.hash:
131127
raise ValidationError("Failed to verify hash.")
132128

0 commit comments

Comments
 (0)