Move `TxTemplate` to `bdk_testenv` and make it better
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
- Move
TxTemplatetypes and logic tobdk_testenv. - Use
Cow<'static, B>for struct fields andinit_graphinputs. This allows us to be more flexible when creating templates (they can be owned and returned by methods and manipulated later on). - Redo the benchmarks introduced by bitcoindevkit/bdk#1670 using
TxTemplate. - 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 I would like to work on this.
Can i work on this? Is it closed? I would like to learn on how to contribute to this project.
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.
@notmandatory: This issue focuses on the chain and testenv crates, so it should remain in the bdk repo.
Oops thanks @ValuedMammal for moving this back to bdk.