bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Move `TxTemplate` to `bdk_testenv` and make it better

Open evanlinjin opened this issue 1 year ago • 5 comments

Context

The TxTemplate stuff currently resides in crates/chain/tests/common/mod.rs, making it only accessible for bdk_chain tests residing in the tests dir.

However, building a TxGraph from TxTemplates are useful elsewhere (such as for benchmarks as I've discovered while working on bitcoindevkit/bdk#1670 - more on this later).

Proposal

  1. Move TxTemplate types and logic to bdk_testenv.
  2. Use Cow<'static, B> for struct fields and init_graph inputs. This allows us to be more flexible when creating templates (they can be owned and returned by methods and manipulated later on).
  3. Redo the benchmarks introduced by bitcoindevkit/bdk#1670 using TxTemplate.
  4. Come up with helper methods to make the work in 3. easier.

Dependencies

This should be done after bitcoindevkit/bdk#1670 is merged to avoid merge conflicts.

evanlinjin avatar Dec 03 '24 12:12 evanlinjin

@evanlinjin I would like to work on this.

tvpeter avatar Dec 14 '24 15:12 tvpeter

Can i work on this? Is it closed? I would like to learn on how to contribute to this project.

yaegeristhitesh avatar Jan 25 '25 05:01 yaegeristhitesh

Hey, @notmandatory, can I work on this issue? Since the PR doesn’t seem to be active, I believe the issue is still open for contributions.

vkprogrammer-001 avatar Mar 31 '25 19:03 vkprogrammer-001

@notmandatory: This issue focuses on the chain and testenv crates, so it should remain in the bdk repo.

tvpeter avatar Apr 08 '25 10:04 tvpeter

Oops thanks @ValuedMammal for moving this back to bdk.

notmandatory avatar Apr 09 '25 03:04 notmandatory