diff options
author | Michael Jurkoic <mjjurkoic@gmail.com> | 2024-03-23 11:38:29 -0500 |
---|---|---|
committer | Michael Jurkoic <mjjurkoic@gmail.com> | 2024-03-23 11:38:29 -0500 |
commit | 111b9914c601730a3697a3b7ff8a60fd2c15a38a (patch) | |
tree | e069cc2ebd8191eb3157bb713ca0cc40e51640d5 /src/event.cpp | |
parent | 8dbce9cd5aab9129e66a0c04e31467d172344f19 (diff) |
Get smarter with pointers so tests pass
Diffstat (limited to 'src/event.cpp')
-rw-r--r-- | src/event.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/event.cpp b/src/event.cpp index a24a594..e77e33d 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -11,6 +11,7 @@ using nlohmann::json; using std::hex; using std::invalid_argument; +using std::make_shared; using std::setw; using std::setfill; using std::shared_ptr; @@ -20,7 +21,7 @@ using std::time; namespace nostr { -string Event::serialize(shared_ptr<ISigner> signer) +string Event::serialize() { try { @@ -41,7 +42,6 @@ string Event::serialize(shared_ptr<ISigner> signer) }; j["id"] = this->generateId(j.dump()); - j["sig"] = signer->generateSignature(shared_ptr<Event>(this)); json jarr = json::array({ "EVENT", j }); @@ -80,8 +80,8 @@ void Event::validate() throw std::invalid_argument("Event::validate: A valid event kind is required."); } - bool hasSig = this->sig.length() > 0; - if (!hasSig) + bool hasSignature = this->sig.length() > 0; + if (!hasSignature) { throw std::invalid_argument("Event::validate: The event must be signed."); } |