Skip to content

test: add legacy descriptor tests #214

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
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

luisschwab
Copy link
Contributor

@luisschwab luisschwab commented Apr 22, 2025

Description

This PR closes #134 and is a revival of bitcoindevkit/bdk#1130, which adds the following tests:

  • test_legacy_bump_fee_no_change_add_input_and_change()
  • test_legacy_bump_fee_add_input()
  • test_legacy_bump_fee_drain_wallet()
  • test_legacy_bump_fee_zero_abs()
  • test_legacy_create_tx_custom_sighash()
  • test_legacy_create_tx_default_sighash()
  • test_legacy_create_tx_absolute_high_fee()
  • test_legacy_create_tx_absolute_zero_fee()
  • test_legacy_create_tx_absolute_fee()
  • test_legacy_create_tx_custom_fee_rate()
  • test_legacy_get_funded_wallet_tx_fee_rate()

Modifications to the assert_fee_rate! macro were necessary for it to work with legacy transactions:

  • Enable it to get the input amount from the legacy PSBT field.
  • Drop the tx_fee_rate - fee_rate < half_default check for legacy transactions.

I also made the change descriptor optional on get_funded_wallet() as per bitcoindevkit/bdk#1533 and fixed clippy warnings.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

@coveralls
Copy link

coveralls commented Apr 22, 2025

Pull Request Test Coverage Report for Build 14586112354

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 86.53%

Totals Coverage Status
Change from base Build 14270666930: 0.005%
Covered Lines: 7272
Relevant Lines: 8404

💛 - Coveralls

@luisschwab luisschwab force-pushed the feat/add-legacy-tests branch from 9f667ca to 5f9d18c Compare April 22, 2025 03:34
@ValuedMammal ValuedMammal added the tests New or improved tests label Apr 22, 2025
@ValuedMammal ValuedMammal moved this to Needs Review in BDK Wallet Apr 22, 2025
@ValuedMammal ValuedMammal added this to the 2.0.0 milestone Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests New or improved tests
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Add legacy wallet tests
3 participants