Skip to content

Commit b301ac4

Browse files
committed
Add documentation.
1 parent 96f8a8b commit b301ac4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,16 @@ To list a specific event type, call the `read_event_type` function with the even
506506
event_type = await client.read_event_type("io.eventsourcingdb.library.book-acquired")
507507
```
508508

509+
### Verifying an Event's Hash
510+
511+
To verify the integrity of an event, call the `verify_hash` function on the event instance. This recomputes the event's hash locally and compares it to the hash stored in the event. If the hashes differ, the function raises an error:
512+
513+
```python
514+
event.verify_hash();
515+
```
516+
517+
*Note that this only verifies the hash. If you also want to verify the signature, you can skip this step and call `verifySignature` directly, which performs a hash verification internally.*
518+
509519
### Using Testcontainers
510520

511521
Import the `Container` class, create an instance, call the `start` function to run a test container, get a client, run your test code, and finally call the `stop` function to stop the test container:

0 commit comments

Comments
 (0)