mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
Add SuspendedPayment{Create,Finish,Cancel}
* Add SusPay core tests
* Rename SusPay -> SuspendedPayment (code review)
* Rename cancelAfter -> allowCancelAfter
* Rename suspendedPayment{Finish,Execution}
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable no-new, max-len, no-comma-dangle, indent */
|
||||
/* eslint-disable no-new, max-len, no-comma-dangle, indent, max-nested-callbacks */
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -14,7 +14,9 @@ const Amount = require('ripple-lib').Amount;
|
||||
const PathFind = require('ripple-lib')._test.PathFind;
|
||||
const Log = require('ripple-lib')._test.Log;
|
||||
|
||||
let options, remote, callback;
|
||||
let options;
|
||||
let remote;
|
||||
let callback;
|
||||
|
||||
const ADDRESS = 'r4qLSAzv4LZ9TLsR7diphGwKnSEAMQTSjS';
|
||||
const LEDGER_INDEX = 9592219;
|
||||
@@ -2095,4 +2097,50 @@ describe('Remote', function() {
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
it('Construct SuspendedPaymentCreate transaction', function() {
|
||||
const tx = remote.createTransaction('SuspendedPaymentCreate', {
|
||||
account: TX_JSON.Account,
|
||||
destination: TX_JSON.Destination,
|
||||
amount: TX_JSON.Amount
|
||||
});
|
||||
|
||||
assert.deepEqual(tx.tx_json, {
|
||||
Flags: 0,
|
||||
TransactionType: 'SuspendedPaymentCreate',
|
||||
Account: TX_JSON.Account,
|
||||
Destination: TX_JSON.Destination,
|
||||
Amount: TX_JSON.Amount
|
||||
});
|
||||
});
|
||||
it('Construct SuspendedPaymentFinish transaction', function() {
|
||||
const tx = remote.createTransaction('SuspendedPaymentFinish', {
|
||||
account: TX_JSON.Account,
|
||||
owner: TX_JSON.Account,
|
||||
paymentSequence: 1234
|
||||
});
|
||||
|
||||
assert.deepEqual(tx.tx_json, {
|
||||
Flags: 0,
|
||||
TransactionType: 'SuspendedPaymentFinish',
|
||||
Account: TX_JSON.Account,
|
||||
Owner: TX_JSON.Account,
|
||||
OfferSequence: 1234
|
||||
});
|
||||
});
|
||||
it('Construct SuspendedPaymentCancel transaction', function() {
|
||||
const tx = remote.createTransaction('SuspendedPaymentCancel', {
|
||||
account: TX_JSON.Account,
|
||||
owner: TX_JSON.Account,
|
||||
paymentSequence: 1234
|
||||
});
|
||||
|
||||
assert.deepEqual(tx.tx_json, {
|
||||
Flags: 0,
|
||||
TransactionType: 'SuspendedPaymentCancel',
|
||||
Account: TX_JSON.Account,
|
||||
Owner: TX_JSON.Account,
|
||||
OfferSequence: 1234
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user