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

bitcoin core v23 creates descriptor wallets by default #1192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/bitcoin/BitcoinClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,14 @@ export default class BitcoinClient {
}

private async createWallet () {
// Bitcoin Core 23.0 creates discriptor wallets by default, must set to false until further updates can be made to this repo.
// https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-23.0.md#wallet
const request = {
method: 'createwallet',
params: [this.walletNameToUse] // the wallet name
params: {
wallet_name: this.walletNameToUse,
descriptors: false
}
};

// Intentionally not throwing because bitcoin returns 500 when a wallet is already created
Expand Down
15 changes: 12 additions & 3 deletions tests/bitcoin/BitcoinClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,10 @@ describe('BitcoinClient', async () => {
await bitcoinClient['createWallet']();
expect(rpcSpy).toHaveBeenCalledWith({
method: 'createwallet',
params: ['sidetreeDefaultWallet']
params: {
wallet_name: 'sidetreeDefaultWallet',
descriptors: false
}
}, true, false);
expect(loggerSpy).toHaveBeenCalledWith(`Wallet created with name "sidetreeDefaultWallet".`);
});
Expand All @@ -388,7 +391,10 @@ describe('BitcoinClient', async () => {
} catch {
expect(rpcSpy).toHaveBeenCalledWith({
method: 'createwallet',
params: ['sidetreeDefaultWallet']
params: {
wallet_name: 'sidetreeDefaultWallet',
descriptors: false
}
}, true, false);
}
});
Expand All @@ -399,7 +405,10 @@ describe('BitcoinClient', async () => {
await bitcoinClient['createWallet']();
expect(rpcSpy).toHaveBeenCalledWith({
method: 'createwallet',
params: ['sidetreeDefaultWallet']
params: {
wallet_name: 'sidetreeDefaultWallet',
descriptors: false
}
}, true, false);
expect(loggerSpy).toHaveBeenCalledWith(`Wallet with name sidetreeDefaultWallet already exists.`);
});
Expand Down