mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
Merge pull request #589 from wltsmrz/multisign-update
Fix Transaction.complete() for multisigned transactions
This commit is contained in:
@@ -2302,6 +2302,10 @@ describe('Transaction', function() {
|
||||
{Signer: s2},
|
||||
{Signer: s1}
|
||||
]);
|
||||
|
||||
transaction.remote = new Remote();
|
||||
assert(transaction.complete());
|
||||
assert.strictEqual(transaction.tx_json.SigningPubKey, '');
|
||||
});
|
||||
|
||||
it('Multisign -- missing LastLedgerSequence', function() {
|
||||
@@ -2317,4 +2321,27 @@ describe('Transaction', function() {
|
||||
transaction.getMultiSigningJson();
|
||||
});
|
||||
});
|
||||
|
||||
it('Multisign -- LastLedgerSequence autofill', function() {
|
||||
const transaction = Transaction.from_json({
|
||||
Account: 'rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn',
|
||||
Sequence: 1,
|
||||
Fee: '100',
|
||||
TransactionType: 'AccountSet',
|
||||
Flags: 0
|
||||
});
|
||||
|
||||
const sequence = 1;
|
||||
transaction.remote = {
|
||||
getLedgerSequenceSync: () => {
|
||||
return sequence;
|
||||
}
|
||||
};
|
||||
|
||||
const mJson = transaction.getMultiSigningJson();
|
||||
assert.strictEqual(mJson.LastLedgerSequence,
|
||||
sequence + 1 + transaction._lastLedgerOffset);
|
||||
assert.strictEqual(transaction.tx_json.LastLedgerSequence,
|
||||
sequence + 1 + transaction._lastLedgerOffset);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user