Skip to content

Conversation

@shesek
Copy link
Collaborator

@shesek shesek commented Aug 31, 2023

Based on top of #59, which should get merged first. Replaces #46.

  • Uses the bitcoind and elementsd crates to setup a regtest testing environment

  • Includes 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


log::info!("node params: {:?}", params);

generate(node_client, 101).chain_err(|| "failed initializing blocks")?;
Copy link
Collaborator

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

Copy link
Collaborator Author

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?

Copy link
Collaborator

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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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::{
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@LeoComandini
Copy link
Collaborator

Why 462222b is marked as "unverified"?

@LeoComandini
Copy link
Collaborator

LeoComandini commented Feb 7, 2024

utACK 126dc19 with minor comments, code review

Very nice to have the test infrastructure and all of these tests added!

@shesek
Copy link
Collaborator Author

shesek commented Feb 8, 2024

Why 462222b is marked as "unverified"?

I'm not sure why that happened, but the followup commit d238457 is signed and covers 462222b too

@shesek
Copy link
Collaborator Author

shesek commented Feb 8, 2024

I force-pushed to rebase over the recent changes in #59. This also re-signed all the commits.

@shesek shesek merged commit d630be3 into Blockstream:new-index Feb 10, 2024
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.

2 participants