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

Height input to block query #7592

Merged
merged 3 commits into from
Jan 21, 2021
Merged

Height input to block query #7592

merged 3 commits into from
Jan 21, 2021

Conversation

psteckler
Copy link
Member

Allow height argument to QraphQL block query.

With this change, the query requires exactly one of height or stateHash (allowing both would not be sensible, I think).

Tested against a local network.

@psteckler psteckler requested a review from a team as a code owner January 21, 2021 20:52
(fun {ctx= coda; _} () (state_hash_base58_opt : string option)
(height_opt : int option) ->
let have_state_hash = Option.is_some state_hash_base58_opt in
let have_height = Option.is_some height_opt in
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think this function would be cleaner using a pattern match on (state_hash_opt, height_opt), then you won't need the value_exn later.

As written, it looks correct to me. But I'm worried that future edits to this function could introduce crashes accidentally when we're relying on the value_exns.

But I won't block the PR on it -- if you do want to change it, let me know and I'll look at it again

@psteckler psteckler added ci-build-me Add this label to trigger a circle+buildkite build for this branch ready-to-merge Adding this label will trigger mergify and trigger CI to run and merge the PR labels Jan 21, 2021
Copy link
Member

@bkase bkase left a comment

Choose a reason for hiding this comment

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

Beautiful!

@lk86 lk86 merged commit 8c06dd2 into compatible Jan 21, 2021
@lk86 lk86 deleted the feature/height-in-block-query branch January 21, 2021 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch ready-to-merge Adding this label will trigger mergify and trigger CI to run and merge the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants