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

allow generate() to return SSB URIs as keys.id #98

Merged
merged 1 commit into from
Jun 4, 2022

Conversation

staltz
Copy link
Member

@staltz staltz commented Jun 4, 2022

Context: we're introducing new feed formats in ssb-db2, but to generate the keys for those feed formats, ...

Problem: we're calling generate() and then mutating the return value keys such that keys.id is an SSB URI for the corresponding feed type. Sad example: https://github.com/ssbc/ssb-db2/blob/f976aac9a4bd4ee804b9f4cd24511dec52cb5d9d/test/basic.js#L372-L376

Solution: this PR allows you to pass an argument to generate() informing it of which feed format this key is for, which then automatically determines what the keys.id should be.

@staltz staltz requested a review from arj03 June 4, 2022 13:32
Copy link
Member

@arj03 arj03 left a comment

Choose a reason for hiding this comment

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

nice refactor/feature for the other modules

@staltz staltz merged commit a652647 into main Jun 4, 2022
@staltz staltz deleted the generate-feed-format-id branch June 4, 2022 15:38
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.

2 participants