diff --git a/lib/bitcoin/BitcoinClient.ts b/lib/bitcoin/BitcoinClient.ts index 5656083ac..b60bc10ee 100644 --- a/lib/bitcoin/BitcoinClient.ts +++ b/lib/bitcoin/BitcoinClient.ts @@ -236,9 +236,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 diff --git a/tests/bitcoin/BitcoinClient.spec.ts b/tests/bitcoin/BitcoinClient.spec.ts index decf20d23..bfce3fdbf 100644 --- a/tests/bitcoin/BitcoinClient.spec.ts +++ b/tests/bitcoin/BitcoinClient.spec.ts @@ -338,7 +338,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".`); }); @@ -351,7 +354,10 @@ describe('BitcoinClient', async () => { } catch { expect(rpcSpy).toHaveBeenCalledWith({ method: 'createwallet', - params: ['sidetreeDefaultWallet'] + params: { + wallet_name: 'sidetreeDefaultWallet', + descriptors: false + } }, true, false); } }); @@ -362,7 +368,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.`); });