diff --git a/lib/bitcoin/BitcoinClient.ts b/lib/bitcoin/BitcoinClient.ts index 90a7c6412..3a03d7930 100644 --- a/lib/bitcoin/BitcoinClient.ts +++ b/lib/bitcoin/BitcoinClient.ts @@ -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 diff --git a/tests/bitcoin/BitcoinClient.spec.ts b/tests/bitcoin/BitcoinClient.spec.ts index cd325b4cc..b8ad9b69e 100644 --- a/tests/bitcoin/BitcoinClient.spec.ts +++ b/tests/bitcoin/BitcoinClient.spec.ts @@ -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".`); }); @@ -388,7 +391,10 @@ describe('BitcoinClient', async () => { } catch { expect(rpcSpy).toHaveBeenCalledWith({ method: 'createwallet', - params: ['sidetreeDefaultWallet'] + params: { + wallet_name: 'sidetreeDefaultWallet', + descriptors: false + } }, true, false); } }); @@ -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.`); });