From 5f61d80e2ddb576a4e5d4d5d20a82890ab8c6940 Mon Sep 17 00:00:00 2001 From: Chris Clark Date: Mon, 24 Aug 2015 17:28:48 -0700 Subject: [PATCH] Fix bugs in compiled library --- src/core/serializedtypes.js | 3 ++- test/fixtures/api/rippled/account-tx.js | 2 +- test/uint-test.js | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/serializedtypes.js b/src/core/serializedtypes.js index 1d74e5e2..f8787d46 100644 --- a/src/core/serializedtypes.js +++ b/src/core/serializedtypes.js @@ -8,6 +8,7 @@ * SerializedObject.parse() or SerializedObject.serialize(). */ +const _ = require('lodash'); const assert = require('assert'); const extend = require('extend'); const BN = require('bn.js'); @@ -404,7 +405,7 @@ exports.Quality = new SerializedType({ serialize: function(so, val) { let value; // if in format: amount/currency/issuer - if (val.includes('/')) { + if (_.includes(val, '/')) { const amount = Amount.from_json(val); if (!amount.is_valid()) { diff --git a/test/fixtures/api/rippled/account-tx.js b/test/fixtures/api/rippled/account-tx.js index 156e51c2..1d18fb45 100644 --- a/test/fixtures/api/rippled/account-tx.js +++ b/test/fixtures/api/rippled/account-tx.js @@ -7,7 +7,7 @@ const SerializedObject = require('ripple-lib').SerializedObject; const AccountSet = require('./tx/account-set.json'); const NotFound = require('./tx/not-found.json'); -module.exports = function(request, options={}) { +module.exports = function(request, options = {}) { _.defaults(options, { memos: [{ Memo: { diff --git a/test/uint-test.js b/test/uint-test.js index 596aef3f..93afe2a2 100644 --- a/test/uint-test.js +++ b/test/uint-test.js @@ -1,7 +1,7 @@ 'use strict'; /* eslint-disable max-len */ - +const _ = require('lodash'); const assert = require('assert-diff'); const lodash = require('lodash'); const ripple = require('ripple-lib'); @@ -75,11 +75,11 @@ function makeTests(uIntType) { case undefined: switch (test.outputMethod) { case 'to_bytes': - test.expected = Array(rippleType.width).fill(0); + test.expected = _.fill(Array(rippleType.width), 0); break; case 'to_json': case 'to_hex': - test.expected = Array(rippleType.width * 2).fill(0).join(''); + test.expected = _.fill(Array(rippleType.width * 2), 0).join(''); break; } }