From 94293fd82f101b71c62d9f5354c1bc26a5f96d16 Mon Sep 17 00:00:00 2001 From: Golo Roden Date: Wed, 1 Oct 2025 07:53:04 +0200 Subject: [PATCH 1/4] fix: Add missing docs. --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b8c371f..c600711 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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: From c599cdd8390a94972c7e19366ce671a247e000b5 Mon Sep 17 00:00:00 2001 From: Golo Roden Date: Wed, 1 Oct 2025 07:58:03 +0200 Subject: [PATCH 2/4] Fix typo. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c600711..491e367 100644 --- a/README.md +++ b/README.md @@ -398,7 +398,7 @@ match result { If you only want to list subjects within a specific branch, provide the desired base subject instead: ```rust -let result := client.list_subjects("/books"); +let result = client.list_subjects("/books"); ``` ### Listing Event Types @@ -406,7 +406,7 @@ let result := client.list_subjects("/books"); To list all event types, call the `list_event_types` function. The function returns a stream from which you can retrieve one event type at a time: ```rust -let result := client.list_event_types().await; +let result = client.list_event_types().await; match result { Ok(event_types) => // ... Err(err) => // ... @@ -419,7 +419,7 @@ To list a specific event type, call the `read_event_type` function. The function ```rust let event_type_name = "io.eventsourcingdb.library.book-acquired"; -let result := client.read_event_type(event_type_name).await; +let result = client.read_event_type(event_type_name).await; match result { Ok(event_type) => // ... Err(err) => // ... @@ -431,7 +431,7 @@ match result { 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() +let result = event.verify_hash() match result { Ok() => // ... Err(err) => // ... From 4f175ff35c52659581d31c19f444393dc8738991 Mon Sep 17 00:00:00 2001 From: Golo Roden Date: Wed, 1 Oct 2025 07:59:25 +0200 Subject: [PATCH 3/4] Fix another typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 491e367..f2d9213 100644 --- a/README.md +++ b/README.md @@ -431,7 +431,7 @@ match result { 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() +let result = event.verify_hash(); match result { Ok() => // ... Err(err) => // ... From b16d18f953e105d5d6fcaa45bfa58fac3115c856 Mon Sep 17 00:00:00 2001 From: Golo Roden Date: Wed, 1 Oct 2025 08:00:42 +0200 Subject: [PATCH 4/4] Fix another typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f2d9213..2718432 100644 --- a/README.md +++ b/README.md @@ -433,7 +433,7 @@ To verify the integrity of an event, call the `verify_hash` function on the even ```rust let result = event.verify_hash(); match result { - Ok() => // ... + Ok(()) => // ... Err(err) => // ... } ```