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

Move TxTemplate to bdk_testenv and make it better #1754

Open
evanlinjin opened this issue Dec 3, 2024 · 1 comment
Open

Move TxTemplate to bdk_testenv and make it better #1754

evanlinjin opened this issue Dec 3, 2024 · 1 comment
Assignees
Labels
good first issue Good for newcomers tests

Comments

@evanlinjin
Copy link
Member

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 #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 Introduce O(n) canonicalization algorithm #1670 using TxTemplate.
  4. Come up with helper methods to make the work in 3. easier.

Dependencies

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

@evanlinjin evanlinjin added good first issue Good for newcomers tests labels Dec 3, 2024
@notmandatory notmandatory added this to BDK Dec 6, 2024
@notmandatory notmandatory moved this to Todo in BDK Dec 6, 2024
@tvpeter
Copy link
Contributor

tvpeter commented Dec 14, 2024

@evanlinjin I would like to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers tests
Projects
Status: Todo
Development

No branches or pull requests

2 participants