Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ match result {
}
```

### Listing a Specific Event Types
### Listing a Specific Event Type

To list a specific event type, call the `read_event_type` function. The function returns the detailed event type, which includes the schema:

Expand All @@ -426,6 +426,20 @@ match result {
}
```

### Verifying an Event's Hash

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 returns an error:

```rust
let result := event.verify_hash()
match result {
Ok() => // ...
Err(err) => // ...
}
```

*Note that this only verifies the hash. If you also want to verify the signature, you can skip this step and call `verify_signature` directly, which performs a hash verification internally.*

### Using Testcontainers

Call the `Container::start_default()` function, get a client, and run your test code:
Expand Down