wallet-rpc: get input paths when creating batch
This commit is contained in:
parent
1ada5b4947
commit
4e9c7fcbb1
2 changed files with 25 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue