-
Notifications
You must be signed in to change notification settings - Fork 154
Integration tests for the HTTP and Electrum APIs #60
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
Conversation
|
|
||
| log::info!("node params: {:?}", params); | ||
|
|
||
| generate(node_client, 101).chain_err(|| "failed initializing blocks")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you only need to generate 2 blocks on Liquid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it worth adding a #cfg[] block for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure, it's just a small speed up, feel free to ignore
|
|
||
| use bitcoind::bitcoincore_rpc::RpcApi; | ||
| use electrumd::jsonrpc::serde_json::json; | ||
| use electrumd::ElectrumD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you decided to use electrumd instead of electrum-client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
electrumd runs the electrum wallet side, as an headless JSONRPC server daemon.
I could use electrum-client to connect to the JSONRPC, but electrumd already provides an internal client for that purpose (I created electrumd based on the bitcoind crate by @RCasatta, which uses the jsonrpc crate)
|
|
||
| use noded::bitcoincore_rpc::{self, RpcApi}; | ||
|
|
||
| use electrs::{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you avoided electrsd because it does not allow enough control on electrs internals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using electrsd would tie us to the electrs version shipped with it, I wanted the tests to run directly against the work dir code base.
|
Why 462222b is marked as "unverified"? |
|
utACK 126dc19 with minor comments, code review Very nice to have the test infrastructure and all of these tests added! |
|
I force-pushed to rebase over the recent changes in #59. This also re-signed all the commits. |
Using the headless Electrum wallet daemon: https://electrum.readthedocs.io/en/latest/jsonrpc.html
Using the `elementsd` crate to spawn a regtest elements envirnoment.
Confidentiality, asset issuance and signed blocks (dynafed)
Based on top of #59, which should get merged first. Replaces #46.
Uses the
bitcoindandelementsdcrates to setup a regtest testing environmentIncludes tests for the HTTP API. Covers all the important endpoints but does not extensively test the all the response fields.
Includes tests for the Electrum JSONRPC server, using an headless Electrum wallet (
electrumd)Includes tests for Elements-specific functionality (confidentiality, asset issuance and dynafed - but not for peg in/out which is not enabled in the regtest environment)
Includes a Github Actions CI runner