Support removing a signer list (#1021)

* Make weights an optional field
* Fix #971
This commit is contained in:
Namrata
2019-07-30 16:48:30 -07:00
committed by Elliot Lee
parent 229360d1b9
commit b4a30d49d8
9 changed files with 58 additions and 17 deletions

View File

@@ -1767,19 +1767,15 @@ describe('RippleAPI', function () {
};
});
it('prepareSettings - signers no weights', function (done) {
it('prepareSettings - signers no weights', function () {
const settings = requests.prepareSettings.signers.noWeights;
try {
this.api.prepareSettings(address, settings, instructionsWithMaxLedgerVersionOffset).then(prepared => {
done(new Error('Expected method to reject. Prepared transaction: ' + JSON.stringify(prepared)));
}).catch(err => {
assert.strictEqual(err.name, 'ValidationError');
assert.strictEqual(err.message, 'instance.settings.signers requires property "weights"');
done();
}).catch(done); // Finish test with assertion failure immediately instead of waiting for timeout.
} catch (err) {
done(new Error('Expected method to reject, but method threw. Thrown: ' + err));
};
const localInstructions = _.defaults({
signersCount: 1
}, instructionsWithMaxLedgerVersionOffset);
return this.api.prepareSettings(
address, settings, localInstructions).then(
_.partial(checkResult, responses.prepareSettings.noWeights,
'prepare'));
});
it('prepareSettings - fee for multisign', function () {
@@ -1792,6 +1788,17 @@ describe('RippleAPI', function () {
'prepare'));
});
it('prepareSettings - no signer list', function () {
const settings = requests.prepareSettings.noSignerEntries;
const localInstructions = _.defaults({
signersCount: 1
}, instructionsWithMaxLedgerVersionOffset);
return this.api.prepareSettings(
address, settings, localInstructions).then(
_.partial(checkResult, responses.prepareSettings.noSignerList,
'prepare'));
});
it('prepareSettings - invalid', function (done) {
// domain must be a string
const settings = Object.assign({},