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

feat: add /key-blocks/:hash_or_kbi/micro-blocks endpoint #896

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

sborrazas
Copy link
Contributor

refs #888

requires #895 to be merged first

@sborrazas sborrazas self-assigned this Sep 8, 2022
Copy link
Member

@jyeshe jyeshe left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just two cleanup minors.

Comment on lines +168 to +170
with_mocks [
{:aec_chain, [], [get_block: fn ^decoded_hash -> :error end]}
] do
Copy link
Member

Choose a reason for hiding this comment

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

Possibly not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's needed because the fetch_key_block_micro_blocks function will check for the hash existing by using :aec_chain.get_block(kb_hash)

{{height, 0}, {height, Util.max_256bit_int()}},
cursor
)
|> Stream.take_while(&match?({^height, _mbi}, &1))
Copy link
Member

Choose a reason for hiding this comment

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

key boundary should cover this match

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Base automatically changed from key-block-v2 to master September 12, 2022 13:17
@sborrazas sborrazas merged commit 0540074 into master Sep 12, 2022
@sborrazas sborrazas deleted the micro-blocks-v2 branch September 12, 2022 13:33
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.

None yet

3 participants