aboutsummaryrefslogtreecommitdiff
path: root/include/nostr.hpp
diff options
context:
space:
mode:
authorLibravatar Michael Jurkoic <mjjurkoic@gmail.com>2024-04-15 09:55:16 -0500
committerLibravatar Michael Jurkoic <mjjurkoic@gmail.com>2024-04-15 09:55:16 -0500
commit164eaab23e36be7300b740d1a0e37155c02755ff (patch)
tree941e75aa6bbf360a36caf258b92612e871c91181 /include/nostr.hpp
parented539e09128b88080de9e2b31fda931cbc5c0399 (diff)
Add unit tests for batch queries
Also add an equality operator for nostr::Event
Diffstat (limited to 'include/nostr.hpp')
-rw-r--r--include/nostr.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/nostr.hpp b/include/nostr.hpp
index 62eceff..5c99bf4 100644
--- a/include/nostr.hpp
+++ b/include/nostr.hpp
@@ -58,6 +58,14 @@ struct Event
*/
static Event fromJson(nlohmann::json j);
+ /**
+ * @brief Compares two events for equality.
+ * @remark Two events are considered equal if they have the same ID, since the ID is uniquely
+ * generated from the event data. If the `id` field is empty for either event, the comparison
+ * function will throw an exception.
+ */
+ bool operator==(const Event& other) const;
+
private:
/**
* @brief Validates the event.