From 6e16bf68ae455f34de72e595b8490cff638c457b Mon Sep 17 00:00:00 2001 From: wltsmrz Date: Fri, 6 Mar 2015 13:01:57 -0800 Subject: [PATCH] Lint serializedobject test --- src/js/ripple/amount.js | 2 +- src/js/ripple/serializedobject.js | 9 ++++----- test/serializedobject-test.js | 15 +++++++++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/js/ripple/amount.js b/src/js/ripple/amount.js index 01a228fc..7f02a164 100644 --- a/src/js/ripple/amount.js +++ b/src/js/ripple/amount.js @@ -713,7 +713,7 @@ Amount.prototype.parse_json = function(j) { Amount.prototype.parse_native = function(j) { if (j && typeof j === 'string' && !isNaN(j)) { if (j.indexOf('.') >= 0) { - throw new Error('Native amounts must be specified in integer drops') + throw new Error('Native amounts must be specified in integer drops'); } var value = new BigNumber(j); this._is_native = true; diff --git a/src/js/ripple/serializedobject.js b/src/js/ripple/serializedobject.js index a05d5fe6..6298ea15 100644 --- a/src/js/ripple/serializedobject.js +++ b/src/js/ripple/serializedobject.js @@ -46,10 +46,9 @@ function SerializedObject(buf) { this.pointer = 0; } -SerializedObject.from_json = function(obj, options) { +SerializedObject.from_json = function(obj) { // Create a copy of the object so we don't modify it obj = extend(true, {}, obj); - options = _.extend({strict: true}, options); var so = new SerializedObject(); var typedef; @@ -95,7 +94,7 @@ SerializedObject.from_json = function(obj, options) { // ND: This from_*json* seems a reasonable place to put validation of `json` SerializedObject.check_no_missing_fields(typedef, obj); - so.serialize(typedef, obj, options); + so.serialize(typedef, obj); return so; }; @@ -237,9 +236,9 @@ SerializedObject.jsonify_structure = function(structure, field_name) { return output; }; -SerializedObject.prototype.serialize = function(typedef, obj, options) { +SerializedObject.prototype.serialize = function(typedef, obj) { // Serialize object without end marker - stypes.Object.serialize(this, obj, options, true); + stypes.Object.serialize(this, obj, true); // ST: Old serialization /* diff --git a/test/serializedobject-test.js b/test/serializedobject-test.js index 03616294..cc8a17ba 100644 --- a/test/serializedobject-test.js +++ b/test/serializedobject-test.js @@ -1,3 +1,15 @@ +'use strict'; + +/* eslint-disable max-len*/ +/* eslint-disable key-spacing*/ +/* eslint-disable no-spaced-func*/ +/* eslint-disable space-before-blocks*/ +/* eslint-disable space-unary-ops*/ +/* eslint-disable no-void*/ +/* eslint-disable semi*/ +/* eslint-disable no-unused-vars*/ +/* eslint-disable quotes*/ + var assert = require('assert'); var SerializedObject = require('ripple-lib').SerializedObject; var Amount = require('ripple-lib').Amount; @@ -160,7 +172,6 @@ describe('Serialized object', function() { }); describe('Memos', function() { - var input_json; beforeEach(function() { @@ -273,7 +284,7 @@ describe('Serialized object', function() { it('should serialize json with memo - match hex output', function() { - var input_json = { + input_json = { Flags: 2147483648, TransactionType: 'Payment', Account: 'rhXzSyt1q9J8uiFXpK3qSugAAPJKXLtnrF',