Skip to content

Commit

Permalink
Fix bugs in compiled library
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Clark committed Aug 25, 2015
1 parent c4fa4c2 commit 5f61d80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/core/serializedtypes.js
Expand Up @@ -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');
Expand Down Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/api/rippled/account-tx.js
Expand Up @@ -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: {
Expand Down
6 changes: 3 additions & 3 deletions 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');
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 5f61d80

Please sign in to comment.