-
Notifications
You must be signed in to change notification settings - Fork 1
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
feature: add unit and integration tests to block events #8
Closed
oleonardolima
wants to merge
7
commits into
feature/add-blocks-stream-as-module
from
feature/add-unit-and-integration-tests-to-block-events
Closed
feature: add unit and integration tests to block events #8
oleonardolima
wants to merge
7
commits into
feature/add-blocks-stream-as-module
from
feature/add-unit-and-integration-tests-to-block-events
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ip non-block data
oleonardolima
changed the base branch from
main
to
feature/add-blocks-stream-as-module
June 24, 2022 01:41
…nit-and-integration-tests-to-block-events
… use new fns and signatures
This PR and its commits have been squashed and merged into #10, to make it easier for review and code checking at this stage. |
oleonardolima
added a commit
that referenced
this pull request
Aug 11, 2022
…point and reorg handling) (#10) * feature: implement an initial mempool.space websocket client, and library for block-events from #3 * feature: add unit and integration tests to block events from #8 * feat+test: add initial http client and tests * wip(feat): add initial approach for subscribing to blocks from a starting height * wip(feat): fix fn and use a tuple as return type for prev and new block streams * wip(refactor): initial updates for fns refactor and architecture change * wip(feat+refactor): add fn to process candidate BlockHeaders, handle reorg and yield BlockEvent * wip(refactor+docs): extract fns to cache struct, and add documentation for fns, enums and structs * wip(fixes+tests): fixes, improve error handling and add new integration tests * wip(fix+test): fix common ancestor and fork branch bug, add new reorg tests * fix: disconnected and connected block events emitting order for reorg events * chore: simplify cli usage and output * chore: update docs and readme examples, use u32 instead of u64 * fix: remaining cargo.toml conflicts from other branches * feat: add full block stream api, better error handling - use TryStream instead of stream, returning result instead - use `?` operator instead of unwraping and panicking - add new mempool.space endpoints for http client - add features for wss:// and https:// usage - add features for api versioning based on mempool.space backend * refactor: do not use features expect two base_url instead, and improve error handling - refactor and update http client, url usage and methods - refactor and add creation methods for cache struct, use specific method to build initial one - add `get_block_header` method in http client, and refactor lib to use `bitcoin::BlockHeader` instead of custom mempool.space `BlockExtended` struct - refactor lib and websocket to improve error handling, update some `unwrap()` usage and match errors for messages in `WebSocketStream` - remove duplicated/unused deps, and use only necessary features * chore: add and update CHANGELOG.md file * fix(test): docs and integration tests - bump mempool/backend docker container version to v2.4.1 - update api+websocket client to handle genesis blocks without prev_blockhash - update and fix integration tests to new fns and structure
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR focus on solving the issues:
Creating a test client for the Bitcoin Core RPC with
bitcoind
, themempool/backend
with it's docker image andtestcontainers-rs
. By using the test client, it's possible to run the docker containers with testcontainers, and subscribe to block-events with the subscribe to blocks fn built on #3As a result, now we have the tests for the websocket module for message building, parsing (both for request and response) and producing the stream of
BlockEvent
.Notes to the reviewers
There were some bugs while running it locally and implementing the tests, that's why it's not using
-rpcuser
and-rpcpassword
as args in bitcoind, it's using the-rpcauth
instead. The bug and further discussion is here: rust-bitcoin/bitcoind#68We thought that we had a bug in
mempool/backend
while trying to useregtest
as a parameter, but it's not supposed to be used, that's why we are not setting it asregtest
in the docker image configuration, the discussion here: mempool/mempool#1916Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md