-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/add nip 58 support in eventbuilder #118
Feature/add nip 58 support in eventbuilder #118
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Thanks! Have you checked the Probably it can be possible to move some things, like If you have not time, let me know that I'll try to merge these two implementations of |
Ohh lol, forgot to theck the nip modules. I'll close this PR then as the nip58 module contains what I need and seems like a much better overall implementation! |
Well.. maybe that's not a bad idea. The structs specifically related to the NIP will belong inside the module, then we can expose a builder of such event in the event builder. I think that makes more sense, but I'm not sure what you intend the NIP modules to be. Do you want each NIP-specific module to take care of everything related to that specific NIP (i.e. data structures as well as building the events) or should they contain related datastructures and operations only and then building the event can be exposed through the EventBuilder interface? |
Until now the event composition was done with The only one struct that build an event outside the If we opt for Option B, I think that |
I'd vote for option A as that makes the most sense for me. I can refactor this PR to fit option A, then you can see if you like it or not. |
Let me know when the PR is ready to be reviewed |
I will! I'm implementing this in nostr-tool to verify that it works as expected but I'm currently having some problems with the get_events_of() function where I always get 0 events back when querying for the badge definition event I created. Need some more time to figure out why that happens. |
This PR is ready for review @yukibtc. I want to say that I'm not an Rust expert(still learning) and these changes are fairly technical for me so please take a good look over the code to ensure that I'm not introducing any newbie mistakes here. The code in the event builder is mostly from the old nip58 functions. Example implementation can be found in this PR: 0xtrr/nostr-tool#54 |
Before merge, can you squash the commits together? |
4dfe1dd
to
cf531e7
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK cf531e7
Description
This PR adds convenience functions to the EventBuilder for creating a new badge and awarding a badge to a set of pubkeys.
Notes to the reviewers
I'd love to get a second look at the functions to verify that it makes sense as is.
I didn't add a function for setting profile badges (the last operation in NIP-58) because I simply couldn't figure out a good way to structure the function inputs so that we ensure a consecutive order in the
a
ande
tags.Changelog notice
Checklists
All Submissions:
make precommit
before committing