Support source.amount in getPaths and destination.minAmount in preparePayment

This commit is contained in:
Chris Clark
2015-09-29 11:03:46 -07:00
parent 8edc3b1f36
commit 35acbb62c3
29 changed files with 641 additions and 91 deletions

View File

@@ -48,7 +48,7 @@ describe('RippleAPI', function() {
}, instructions);
return this.api.preparePayment(
address, requests.preparePayment, localInstructions).then(
_.partial(checkResult, responses.preparePayment, 'prepare'));
_.partial(checkResult, responses.preparePayment.normal, 'prepare'));
});
it('preparePayment with all options specified', function() {
@@ -59,7 +59,7 @@ describe('RippleAPI', function() {
};
return this.api.preparePayment(
address, requests.preparePaymentAllOptions, localInstructions).then(
_.partial(checkResult, responses.preparePaymentAllOptions, 'prepare'));
_.partial(checkResult, responses.preparePayment.allOptions, 'prepare'));
});
});
@@ -67,10 +67,16 @@ describe('RippleAPI', function() {
const localInstructions = _.defaults({sequence: 23}, instructions);
return this.api.preparePayment(
address, requests.preparePaymentNoCounterparty, localInstructions).then(
_.partial(checkResult, responses.preparePaymentNoCounterparty,
_.partial(checkResult, responses.preparePayment.noCounterparty,
'prepare'));
});
it('preparePayment - destination.minAmount', function() {
return this.api.preparePayment(address, responses.getPaths.sendAll[0],
instructions).then(_.partial(checkResult,
responses.preparePayment.minAmount, 'prepare'));
});
it('prepareOrder - buy order', function() {
return this.api.prepareOrder(address, requests.prepareOrder, instructions)
.then(_.partial(checkResult, responses.prepareOrder, 'prepare'));
@@ -639,6 +645,11 @@ describe('RippleAPI', function() {
});
});
it('getPaths - send all', function() {
return this.api.getPaths(requests.getPaths.sendAll).then(
_.partial(checkResult, responses.getPaths.sendAll, 'getPaths'));
});
it('getLedgerVersion', function(done) {
this.api.getLedgerVersion().then((ver) => {
assert.strictEqual(ver, 8819951);