diff --git a/lib/wallet/rpc.js b/lib/wallet/rpc.js index 287eab25..d4cb3620 100644 --- a/lib/wallet/rpc.js +++ b/lib/wallet/rpc.js @@ -2490,6 +2490,8 @@ class RPC extends RPCBase { async createBatch(args, help) { const [actions, options] = this._validateBatch(args, help, 'createbatch'); + options.paths = true; + const wallet = this.wallet; const mtx = await wallet.createBatch(actions, options); @@ -2504,7 +2506,7 @@ class RPC extends RPCBase { const valid = new Validator(args); const check = valid.array(0); - const options = valid.obj(1); + const options = valid.obj(1, {}); const actions = []; for (const action of check) { diff --git a/test/wallet-rpc-test.js b/test/wallet-rpc-test.js index dbf8a6fe..896a8395 100644 --- a/test/wallet-rpc-test.js +++ b/test/wallet-rpc-test.js @@ -799,6 +799,28 @@ describe('Wallet RPC Methods', function() { await nclient.execute('generatetoaddress', [100, addr]); }); + it('should have paths when creating batch', async () => { + const json = await wclient.execute( + 'createbatch', + [ + [['NONE', addr, 1]] + ] + ); + + assert(json.inputs[0].path); + }); + + it('should not have paths when sending batch', async () => { + const json = await wclient.execute( + 'sendbatch', + [ + [['NONE', addr, 1]] + ] + ); + + assert(!json.inputs[0].path); + }); + it('should not send invalid batch: OPEN arguments', async () => { await assert.rejects( wclient.execute(