Skip to content

Commit cfb67fc

Browse files
committed
Merge #600: Change wallet::get_funded_wallet to return Wallet<AnyDatabase>
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
2 parents 7201e09 + e7a56a9 commit cfb67fc

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/wallet/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ use utils::{check_nlocktime, check_nsequence_rbf, After, Older, SecpCtx};
5757

5858
use crate::blockchain::{GetHeight, NoopProgress, Progress, WalletSync};
5959
use crate::database::memory::MemoryDatabase;
60-
use crate::database::{BatchDatabase, BatchOperations, DatabaseUtils, SyncTime};
60+
use crate::database::{AnyDatabase, BatchDatabase, BatchOperations, DatabaseUtils, SyncTime};
6161
use crate::descriptor::derived::AsDerived;
6262
use crate::descriptor::policy::BuildSatisfaction;
6363
use crate::descriptor::{
@@ -1613,17 +1613,13 @@ where
16131613
/// Return a fake wallet that appears to be funded for testing.
16141614
pub fn get_funded_wallet(
16151615
descriptor: &str,
1616-
) -> (
1617-
Wallet<MemoryDatabase>,
1618-
(String, Option<String>),
1619-
bitcoin::Txid,
1620-
) {
1616+
) -> (Wallet<AnyDatabase>, (String, Option<String>), bitcoin::Txid) {
16211617
let descriptors = testutils!(@descriptors (descriptor));
16221618
let wallet = Wallet::new(
16231619
&descriptors.0,
16241620
None,
16251621
Network::Regtest,
1626-
MemoryDatabase::new(),
1622+
AnyDatabase::Memory(MemoryDatabase::new()),
16271623
)
16281624
.unwrap();
16291625

0 commit comments

Comments
 (0)