test: cover TxUpdate::map_anchors#2116
test: cover TxUpdate::map_anchors#2116mubashirrao1122 wants to merge 3 commits intobitcoindevkit:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds unit tests in bdk_core to exercise TxUpdate behaviors, primarily TxUpdate::map_anchors, ensuring anchors are transformed while other update fields remain intact.
Changes:
- Add
TxUpdate::is_emptycoverage for populatedtxsandseen_ats. - Add coverage that
TxUpdate::extendmakes an update non-empty when extending with non-empty data. - Add a
map_anchorstest verifying anchor transformation and preservation oftxidandseen_ats.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
crates/core/tests/test_tx_update.rs
Outdated
| use bitcoin::hashes::Hash; | ||
|
|
There was a problem hiding this comment.
The inner use bitcoin::hashes::Hash; inside test_map_anchors_transforms_anchor_type_and_preserves_txid is redundant because the trait is already imported at module scope. This will trigger unused_imports and fail CI since clippy runs with -D warnings. Remove the inner use (or drop the module-level import and import the trait only where needed, but avoid duplicating it).
| use bitcoin::hashes::Hash; |
There was a problem hiding this comment.
Removed the redundant import to avoid unused_imports under clippy.
This PR adds test coverage for
TxUpdate::map_anchors.It verifies that anchor values are correctly transformed while txids and other
fields (such as
seen_ats) are preserved.Tests: