Skip to content

feat(testenv): Add method new_with_config - #1545

Merged
evanlinjin merged 1 commit into
bitcoindevkit:masterfrom
ValuedMammal:feat/testenv-config
Aug 12, 2024
Merged

feat(testenv): Add method new_with_config#1545
evanlinjin merged 1 commit into
bitcoindevkit:masterfrom
ValuedMammal:feat/testenv-config

Conversation

@ValuedMammal

@ValuedMammal ValuedMammal commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

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

Comment thread crates/testenv/src/lib.rs Outdated
@ValuedMammal

Copy link
Copy Markdown
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
Copy Markdown
Contributor

ACK b3b6551

@evanlinjin evanlinjin left a comment

Copy link
Copy Markdown
Member

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
@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