Get all results when limit is not specified

This commit is contained in:
Chris Clark
2015-07-08 15:13:20 -07:00
parent a464ca2368
commit f3a54bf02a
4 changed files with 14 additions and 13 deletions

View File

@@ -1,9 +1,15 @@
'use strict';
const _ = require('lodash');
const assert = require('assert');
const common = require('../common');
const dropsToXrp = common.dropsToXrp;
const composeAsync = common.composeAsync;
function clamp(value, min, max) {
assert(min <= max, 'Illegal clamp bounds');
return Math.min(Math.max(value, min), max);
}
function getXRPBalance(remote, address, ledgerVersion, callback) {
remote.requestAccountInfo({account: address, ledger: ledgerVersion},
composeAsync((data) => dropsToXrp(data.account_data.Balance), callback));
@@ -29,7 +35,7 @@ function getRecursiveRecur(getter, marker, limit, callback) {
}
function getRecursive(getter, limit, callback) {
getRecursiveRecur(getter, undefined, limit, callback);
getRecursiveRecur(getter, undefined, limit || Infinity, callback);
}
function renameCounterpartyToIssuer(amount) {
@@ -78,6 +84,7 @@ module.exports = {
renameCounterpartyToIssuerInOrder: renameCounterpartyToIssuerInOrder,
getRecursive: getRecursive,
wrapCatch: common.wrapCatch,
clamp: clamp,
common: common
};