-
Notifications
You must be signed in to change notification settings - Fork 331
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
refactor: move tx_template
from bdk_chain
to bdk_testenv
#1800
base: master
Are you sure you want to change the base?
refactor: move tx_template
from bdk_chain
to bdk_testenv
#1800
Conversation
8b81584
to
12181bb
Compare
12181bb
to
13b87ac
Compare
13b87ac
to
dd47a8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this one, so far it's looking good.
Please update the commit messages to follow conventional commits, i.e: `refactor: move `tx_template` from `bdk_chain` to `bdk_testenv`
crates/testenv/Cargo.toml
Outdated
|
||
[dev-dependencies] | ||
bdk_testenv = { path = "." } | ||
rand = "0.8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC this dependency is currently being used only for tx_template
mod, right?
As it's only available when miniscript
feature is being used, it'd be best to make this one an optional dependency tied to that feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is currently only being used in the tx_template
mod.
crates/testenv/src/tx_template.rs
Outdated
pub inputs: Vec<TxInTemplate>, | ||
pub outputs: Vec<TxOutTemplate>, | ||
pub anchors: Vec<A>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tvpeter Any reason/tradeoff on using Vec
, instead of Cow<'_, Tx..>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at it again, there is no trade-off. Thank you for the feedback. I will update it, as Cow
seems more efficient.
- refactor tx_template struct and init_graph to use Cow pointer - move `tx_template` from `chain/tests/common` to `testenv/src` - update `chain/tests` files to use `tx_template` from `testenv` - update deps in `chain/cargo.toml` and `testenv/cargo.toml` - update imports in `testenv/src/lib.rs` - refactor canonical benchmarks in `chain/benches` to use tx_template [Ticket: 1754]
dd47a8b
to
657ffd8
Compare
tx_template
from bdk_chain
to bdk_testenv
Description
This PR implements the following changes:
TxTemplate
fromcrates/chain/tests/common/mod.rs
totestenv
.init_graph
function andTxTemplate
struct to useCow
O(n)
canonicalization algorithm #1670 using TxTemplatesCloses #1754
Notes to the reviewers
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing