From 6dde23e6c66e846c64d49c5258f0dbf44e3d0374 Mon Sep 17 00:00:00 2001 From: Michael Jurkoic Date: Mon, 18 Mar 2024 21:28:19 -0500 Subject: Declare a signer interface --- src/event.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/event.cpp') diff --git a/src/event.cpp b/src/event.cpp index 4ba87d2..a24a594 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -13,13 +13,14 @@ using std::hex; using std::invalid_argument; using std::setw; using std::setfill; +using std::shared_ptr; using std::string; using std::stringstream; using std::time; namespace nostr { -string Event::serialize() +string Event::serialize(shared_ptr signer) { try { @@ -40,8 +41,7 @@ string Event::serialize() }; j["id"] = this->generateId(j.dump()); - - // TODO: Reach out to a signer to sign the event, then set the signature. + j["sig"] = signer->generateSignature(shared_ptr(this)); json jarr = json::array({ "EVENT", j }); -- cgit