mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 20:25:48 +00:00
Fix bugs in compiled library
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
* SerializedObject.parse() or SerializedObject.serialize().
|
* SerializedObject.parse() or SerializedObject.serialize().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const _ = require('lodash');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const extend = require('extend');
|
const extend = require('extend');
|
||||||
const BN = require('bn.js');
|
const BN = require('bn.js');
|
||||||
@@ -404,7 +405,7 @@ exports.Quality = new SerializedType({
|
|||||||
serialize: function(so, val) {
|
serialize: function(so, val) {
|
||||||
let value;
|
let value;
|
||||||
// if in format: amount/currency/issuer
|
// if in format: amount/currency/issuer
|
||||||
if (val.includes('/')) {
|
if (_.includes(val, '/')) {
|
||||||
const amount = Amount.from_json(val);
|
const amount = Amount.from_json(val);
|
||||||
|
|
||||||
if (!amount.is_valid()) {
|
if (!amount.is_valid()) {
|
||||||
|
|||||||
2
test/fixtures/api/rippled/account-tx.js
vendored
2
test/fixtures/api/rippled/account-tx.js
vendored
@@ -7,7 +7,7 @@ const SerializedObject = require('ripple-lib').SerializedObject;
|
|||||||
const AccountSet = require('./tx/account-set.json');
|
const AccountSet = require('./tx/account-set.json');
|
||||||
const NotFound = require('./tx/not-found.json');
|
const NotFound = require('./tx/not-found.json');
|
||||||
|
|
||||||
module.exports = function(request, options={}) {
|
module.exports = function(request, options = {}) {
|
||||||
_.defaults(options, {
|
_.defaults(options, {
|
||||||
memos: [{
|
memos: [{
|
||||||
Memo: {
|
Memo: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/* eslint-disable max-len */
|
/* eslint-disable max-len */
|
||||||
|
const _ = require('lodash');
|
||||||
const assert = require('assert-diff');
|
const assert = require('assert-diff');
|
||||||
const lodash = require('lodash');
|
const lodash = require('lodash');
|
||||||
const ripple = require('ripple-lib');
|
const ripple = require('ripple-lib');
|
||||||
@@ -75,11 +75,11 @@ function makeTests(uIntType) {
|
|||||||
case undefined:
|
case undefined:
|
||||||
switch (test.outputMethod) {
|
switch (test.outputMethod) {
|
||||||
case 'to_bytes':
|
case 'to_bytes':
|
||||||
test.expected = Array(rippleType.width).fill(0);
|
test.expected = _.fill(Array(rippleType.width), 0);
|
||||||
break;
|
break;
|
||||||
case 'to_json':
|
case 'to_json':
|
||||||
case 'to_hex':
|
case 'to_hex':
|
||||||
test.expected = Array(rippleType.width * 2).fill(0).join('');
|
test.expected = _.fill(Array(rippleType.width * 2), 0).join('');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user