Skip to content
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

feat(testenv): Add method new_with_config #1545

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

ValuedMammal
Copy link
Contributor

@ValuedMammal ValuedMammal commented Aug 9, 2024

I think this will be useful for passing a custom bitcoin config including e.g. -blockfilterindex that would not otherwise be included in the default config.

Notes to the reviewers

Any other suggestions let me know @LagginTimes

Changelog notice

  • Added method TestEnv::new_with_config for passing custom bitcoind::Conf, electrsd::Conf config objects

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

@ValuedMammal
Copy link
Contributor Author

I'm curious about the intention to enable http on default. Is it because electrsd requires it?

I tried turning it off, and running

cargo t -p bdk_esplora --all-features -- --test-threads=1

gave this error

running 3 tests
test async_ext::test::test_finalize_chain_update ... FAILED
test blocking_ext::test::test_finalize_chain_update ... FAILED
test blocking_ext::test::update_local_chain ... ok

failures:

---- async_ext::test::test_finalize_chain_update stdout ----
[0] running test case: chain_extends
thread 'async_ext::test::test_finalize_chain_update' panicked at crates/esplora/src/async_ext.rs:469:83:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- blocking_ext::test::test_finalize_chain_update stdout ----
[0] running test case: chain_extends
thread 'blocking_ext::test::test_finalize_chain_update' panicked at crates/esplora/src/blocking_ext.rs:466:83:
called `Option::unwrap()` on a `None` value

This allows passing a custom config for either `BitcoinD` or
`ElectrsD`. We also add a new `pub struct Config` for holding
each of `bitcoind::Conf` and `electrsd::Conf`.
@LagginTimes
Copy link
Contributor

ACK b3b6551

Copy link
Member

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

ACK b3b6551

@evanlinjin evanlinjin merged commit d58d75e into bitcoindevkit:master Aug 12, 2024
12 checks passed
@ValuedMammal ValuedMammal deleted the feat/testenv-config branch August 12, 2024 13:03
@notmandatory notmandatory mentioned this pull request Aug 25, 2024
31 tasks
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