Skip to content

Make corepc-node optional in payjoin-test-utils#1424

Draft
DanGould wants to merge 1 commit intopayjoin:masterfrom
DanGould:test-utils-no-bitcoind
Draft

Make corepc-node optional in payjoin-test-utils#1424
DanGould wants to merge 1 commit intopayjoin:masterfrom
DanGould:test-utils-no-bitcoind

Conversation

@DanGould
Copy link
Contributor

@DanGould DanGould commented Mar 19, 2026

Test constants (ORIGINAL_PSBT, EXAMPLE_URL, etc.) and the TestServices infrastructure don't require bitcoind. Only init_bitcoind* functions need the corepc-node crate, which downloads a ~40MB binary at build time.

Gate corepc-node behind a bitcoind feature (default = on) so downstream consumers can import payjoin-test-utils for constants without triggering the bitcoind download. This unblocks nix environments and CI setups that provide their own bitcoind via BITCOIND_EXE.

The split lets FFI bindings import test constants (originalPsbt(), exampleUrl()) without downloading bitcoind — so dart test, python
-m pytest, npm test work in any environment, not just ones with network access. No new bindings needed — the constants are already
exported through payjoin-ffi's test_utils.rs; the only blocker was corepc-node's build.rs firing unconditionally.

This was claude baby. I needed this for an agent in nix with no network.

Pull Request Checklist

Please confirm the following before requesting review:

@coveralls
Copy link
Collaborator

coveralls commented Mar 19, 2026

Pull Request Test Coverage Report for Build 23306722576

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 84.125%

Totals Coverage Status
Change from base Build 23300212261: 0.0%
Covered Lines: 10646
Relevant Lines: 12655

💛 - Coveralls

Comment on lines +22 to +29
#[cfg(feature = "bitcoind")]
use bitcoin::Amount;
#[cfg(feature = "bitcoind")]
pub use corepc_node;
#[cfg(feature = "bitcoind")]
use corepc_node::AddressType;
#[cfg(feature = "bitcoind")]
use tracing::Level;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: to avoid this kind of confusing feature gating we should move bitcoind to its own module and feature gate the whole thing once

Copy link
Contributor Author

@DanGould DanGould Mar 19, 2026

Choose a reason for hiding this comment

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

o yeah I was only concerned about the gates being clean in a group and forgot about that option. good call.

Copy link
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

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

concept ACK with one structural change request

@DanGould DanGould force-pushed the test-utils-no-bitcoind branch from 2046195 to 9d2151a Compare March 19, 2026 15:56
Test constants (ORIGINAL_PSBT, EXAMPLE_URL, etc.) and the
TestServices infrastructure don't require bitcoind. Only
init_bitcoind* functions need the corepc-node crate, which
downloads a ~40MB binary at build time.

Move bitcoind-dependent functions to a `bitcoind` module,
gated behind a `bitcoind` feature (default = on). Re-export
from crate root for backwards compatibility. Downstream
consumers can now import payjoin-test-utils for constants
without triggering the bitcoind download.
@DanGould DanGould force-pushed the test-utils-no-bitcoind branch from 9d2151a to 87d590c Compare March 19, 2026 16:59
@DanGould DanGould marked this pull request as ready for review March 20, 2026 03:10
@DanGould DanGould marked this pull request as draft March 20, 2026 05:30
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.

3 participants