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

Provide an API endpoint that returns all patterns covering a given address #41

Merged
merged 10 commits into from
Jul 14, 2022

Conversation

nielstron
Copy link
Contributor

@nielstron nielstron commented Jul 13, 2022

This adds the endpoint /v1/patterns/{pattern-frac}
It returns all patterns that completely cover {pattern-frac} (i.e. if the result is non-empty, the user can be sure that {pattern-frac} UTxOs are correctly represented in the DB - this excludes the possibility of dynamically added patterns)

TODO:

  • add endpoint
  • add documentation

Fixes #40 and #38 (?)

Possible alternatives:

  • reduce output to true/false depending on whether the list is non-empty or not
    • pro: reduces size of output
    • thoughts: we have the information anyways, why not expose it? Also, odds are that the output of this function will never be critically large
  • reduce input to only single addresses
    • pro: simplifies logic
    • con: reduces usability, especially considering that the user could also query {pattern-frac} and might be concerned about its completeness

Copy link
Member

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

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

Thanks for the idea and the contribution.

I can help with the documentation / specifications updates. We'll also need to cover the new additions with unit & property tests when applicable.

KtorZ added 2 commits July 14, 2022 08:58
  This allows to test more thoroughly the behavior of the http application, by reaching path that we couldn't otherwise. Note that this also caught a bug in the existing 'deletePattern' endpoint (which would _always_ prevent deletion).
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.

Provide an API to query the patterns matching a pattern
2 participants