feature: add unit and integration tests to block events #8
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