Skip to content
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

Fix/validate nostr event #1983

Merged
merged 2 commits into from
Jan 16, 2023
Merged

Fix/validate nostr event #1983

merged 2 commits into from
Jan 16, 2023

Conversation

bumi
Copy link
Collaborator

@bumi bumi commented Jan 16, 2023

keep event validation in sync with nostr-tools
thogh we do not add nostr-tools to avoid the additional dependency.
this automatically adds the event ID and pubkey if not provided.
making it easier for the webapp
@bumi bumi requested a review from reneaaron January 16, 2023 09:23
@github-actions
Copy link

🚀 Thanks for the pull request!

Here are the current build files for testing:

Download and unzip the file for your browser. Refer to the readme for detailed install instructions.


This build is brought to you by: null (who recently dropped 1000 sats):

The future will be bright because we will create it!

Want to sponsor the next build? send some sats to ⚡️builds@getalby.com (don't forget to provide your name)

Don't forget: keep earning sats!


if (!Array.isArray(event.tags)) return false;
for (const tag of event.tags) {
for (let i = 0; i < event.tags.length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is from: https://github.com/nbd-wtf/nostr-tools/blob/master/event.ts#L61-L77
I copied it from there to be in sync.

Copy link
Contributor

@reneaaron reneaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@bumi bumi merged commit c798028 into master Jan 16, 2023
@bumi bumi deleted the fix/validate-nostr-event branch January 16, 2023 12:50
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants