mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Support removing a signer list (#1021)
* Make weights an optional field * Fix #971
This commit is contained in:
@@ -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({},
|
||||
|
||||
Reference in New Issue
Block a user