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

Add Wallet and TxBuilder tests using test funded wallet #148

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

notmandatory
Copy link
Member

@notmandatory notmandatory commented Apr 20, 2022

This PR adds an example test using the bdk test funded wallet. The example test makes sure the bdk-ffi TxBuilder is able to drain a single wallet UTXO to a single address. More tests can be added as we need them in future PRs.

Required to complete #141

@notmandatory notmandatory changed the title [WIP] test funded wallet Add TxBuilder tests using test funded wallet Apr 20, 2022
@notmandatory notmandatory changed the title Add TxBuilder tests using test funded wallet Add Wallet and TxBuilder tests using test funded wallet Apr 20, 2022
@notmandatory notmandatory self-assigned this Apr 20, 2022
@notmandatory notmandatory added this to the Release 0.6.0 milestone Apr 20, 2022
@artfuldev
Copy link
Contributor

Super cool. If we get a funded wallet with a descriptor I can wrap up #141

@notmandatory
Copy link
Member Author

notmandatory commented May 5, 2022

This is on hold until I can get bitcoindevkit/bdk#600 released in bdk.

Edit: The fixed up get_funded_wallet that returns a Wallet<AnyDatabse> will be in bdk 0.19.0, so I'm moving this PR to milestone 0.7.0.

afilini added a commit to bitcoindevkit/bdk that referenced this pull request May 6, 2022
…base>

e7a56a9 Change wallet::get_funded_wallet to return Wallet<AnyDatabase> (Steve Myers)

Pull request description:

  ### Description

  Change testing function `wallet::get_funded_wallet` to return `Wallet<AnyDatabase>` instead of `Wallet<MemoryDatabase>`. This will allow us to use this function for testing `bdk-ffi` which only works with `Wallet<AnyDatabase>`.

  ### Notes to the reviewers

  This is required to complete bitcoindevkit/bdk-ffi#148.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [ ] I've added tests for the new feature
  * [ ] I've added docs for the new feature
  * [ ] I've updated `CHANGELOG.md`

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [ ] I've added tests to reproduce the issue which are now passing
  * [ ] I'm linking the issue being fixed by this PR

ACKs for top commit:
  afilini:
    ACK e7a56a9

Tree-SHA512: 47b53ab6dcee63fc7b24666d3cf9a0ad832782081dd2fe92961c8c9b4c302df90db96b0b518af71d6cbc85319434971219100f8cedb35ce7212d944db29a4295
@notmandatory notmandatory force-pushed the test_funded_wallet branch 3 times, most recently from d2a0012 to 7fc1cba Compare June 10, 2022 19:36
@notmandatory notmandatory marked this pull request as ready for review June 10, 2022 23:02
@notmandatory
Copy link
Member Author

This should be merged after #162 .

@thunderbiscuit thunderbiscuit self-requested a review June 13, 2022 18:50
Copy link
Member

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK. Wondering if we can break the tests into a different file just to keep the lib.rs from getting too big.

@notmandatory
Copy link
Member Author

Concept ACK. Wondering if we can break the tests into a different file just to keep the lib.rs from getting too big.

I know it looks strange to have such big files with tests at the end, but this is the canonical place to put Rust unit tests.

Copy link
Member

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK cfb67fc.

@notmandatory notmandatory merged commit cc8a17e into bitcoindevkit:master Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants