Skip to content

Move TxTemplate to bdk_testenv and make it better #1936

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

Open
evanlinjin opened this issue Dec 3, 2024 · 5 comments · May be fixed by #1800
Open

Move TxTemplate to bdk_testenv and make it better #1936

evanlinjin opened this issue Dec 3, 2024 · 5 comments · May be fixed by #1800
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 moved this to Todo in BDK Wallet Dec 6, 2024
@tvpeter
Copy link
Contributor

tvpeter commented Dec 14, 2024

@evanlinjin I would like to work on this.

@tvpeter tvpeter linked a pull request Jan 14, 2025 that will close this issue
3 tasks
@notmandatory notmandatory moved this from Todo to Needs Review in BDK Wallet Jan 21, 2025
@yaegeristhitesh
Copy link

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

@vkprogrammer-001
Copy link

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 notmandatory transferred this issue from bitcoindevkit/bdk Apr 7, 2025
@tvpeter
Copy link
Contributor

tvpeter commented Apr 8, 2025

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

@ValuedMammal ValuedMammal transferred this issue from bitcoindevkit/bdk_wallet Apr 8, 2025
@ValuedMammal ValuedMammal removed this from BDK Wallet Apr 8, 2025
@ValuedMammal ValuedMammal moved this to In Progress in BDK Chain Apr 8, 2025
@notmandatory
Copy link
Member

notmandatory commented Apr 9, 2025

Oops thanks @ValuedMammal for moving this back to bdk.

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: In Progress
Development

Successfully merging a pull request may close this issue.

5 participants