mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
Update enum definitions and dependencies * Remove redundant bytes from field definitions * Remove "date-generated" given hand editing * Remove ripple-lib test dependency * Fix linting errors introduced by updated eslint/eslintrc * Ensure STObject.toJSON returns a plain object
This commit is contained in:
4
packages/ripple-binary-codec/.babelrc
Normal file
4
packages/ripple-binary-codec/.babelrc
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"presets" : ["es2015"],
|
||||
"retainLines": true
|
||||
}
|
||||
@@ -12,27 +12,28 @@
|
||||
"test": "test"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-runtime": "^5.8.25",
|
||||
"bn.js": "^3.2.0",
|
||||
"babel-runtime": "^6.6.1",
|
||||
"bn.js": "^4.11.3",
|
||||
"create-hash": "^1.1.2",
|
||||
"decimal.js": "^4.0.2",
|
||||
"decimal.js": "^5.0.8",
|
||||
"inherits": "^2.0.1",
|
||||
"lodash": "^3.10.1",
|
||||
"lodash": "^4.12.0",
|
||||
"ripple-address-codec": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"assert-diff": "^1.0.1",
|
||||
"babel": "^5.8.20",
|
||||
"babel-core": "^5.8.20",
|
||||
"babel-eslint": "^4.0.5",
|
||||
"babel-loader": "^5.3.2",
|
||||
"babel-cli": "^6.8.0",
|
||||
"babel-core": "^6.8.0",
|
||||
"babel-eslint": "^6.0.4",
|
||||
"babel-loader": "^6.2.4",
|
||||
"babel-preset-es2015": "^6.6.0",
|
||||
"babel-register": "^6.8.0",
|
||||
"codecov.io": "^0.1.6",
|
||||
"eslint": "^1.10.3",
|
||||
"fs-extra": "^0.24.0",
|
||||
"eslint": "^2.9.0",
|
||||
"fs-extra": "^0.30.0",
|
||||
"intercept-stdout": "^0.1.2",
|
||||
"istanbul": "~0.3.5",
|
||||
"mocha": "~2.1.0",
|
||||
"ripple-lib": "^0.12.9"
|
||||
"istanbul": "~0.4.3",
|
||||
"mocha": "~2.4.5"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "babel --optional runtime -d distrib/npm/ src/ && cp src/enums/definitions.json distrib/npm/enums",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/* eslint-disable func-style */
|
||||
|
||||
'use strict';
|
||||
|
||||
const types = require('./types');
|
||||
const {HashPrefix} = require('./hash-prefixes');
|
||||
const {BinaryParser} = require('./serdes/binary-parser');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const enums = require('./enums');
|
||||
const {Field} = enums;
|
||||
|
||||
@@ -24,12 +24,13 @@
|
||||
"LEDGER_ENTRY_TYPES": {
|
||||
"Ticket": 84,
|
||||
"LedgerHashes": 104,
|
||||
"EnabledAmendments": 102,
|
||||
"Amendments": 102,
|
||||
"SignerList": 83,
|
||||
"Offer": 111,
|
||||
"AccountRoot": 97,
|
||||
"RippleState": 114,
|
||||
"FeeSettings": 115,
|
||||
"SuspendedPayment": 117,
|
||||
"DirectoryNode": 100,
|
||||
"GeneratorMap": 103,
|
||||
"Contract": 99,
|
||||
@@ -41,7 +42,6 @@
|
||||
{
|
||||
"nth": 0,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E0",
|
||||
"isSerialized": false,
|
||||
"isSigningField": false,
|
||||
"type": "Unknown"
|
||||
@@ -52,7 +52,6 @@
|
||||
{
|
||||
"nth": -1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "FF",
|
||||
"isSerialized": false,
|
||||
"isSigningField": false,
|
||||
"type": "Unknown"
|
||||
@@ -63,7 +62,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "11",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt16"
|
||||
@@ -74,7 +72,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "12",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt16"
|
||||
@@ -85,7 +82,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "13",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt16"
|
||||
@@ -96,7 +92,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "22",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -107,7 +102,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "23",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -118,7 +112,6 @@
|
||||
{
|
||||
"nth": 4,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "24",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -129,7 +122,6 @@
|
||||
{
|
||||
"nth": 5,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "25",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -140,7 +132,6 @@
|
||||
{
|
||||
"nth": 6,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "26",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -151,7 +142,6 @@
|
||||
{
|
||||
"nth": 7,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "27",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -162,7 +152,6 @@
|
||||
{
|
||||
"nth": 8,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "28",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -173,7 +162,6 @@
|
||||
{
|
||||
"nth": 9,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "29",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -184,7 +172,6 @@
|
||||
{
|
||||
"nth": 10,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2A",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -195,7 +182,6 @@
|
||||
{
|
||||
"nth": 11,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2B",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -206,7 +192,6 @@
|
||||
{
|
||||
"nth": 12,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2C",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -217,7 +202,6 @@
|
||||
{
|
||||
"nth": 13,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2D",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -228,7 +212,6 @@
|
||||
{
|
||||
"nth": 14,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2E",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -239,7 +222,6 @@
|
||||
{
|
||||
"nth": 16,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2010",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -250,7 +232,6 @@
|
||||
{
|
||||
"nth": 17,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2011",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -261,7 +242,6 @@
|
||||
{
|
||||
"nth": 18,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2012",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -272,7 +252,6 @@
|
||||
{
|
||||
"nth": 19,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2013",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -283,7 +262,6 @@
|
||||
{
|
||||
"nth": 20,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2014",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -294,7 +272,6 @@
|
||||
{
|
||||
"nth": 21,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2015",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -305,7 +282,6 @@
|
||||
{
|
||||
"nth": 22,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2016",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -316,7 +292,6 @@
|
||||
{
|
||||
"nth": 23,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2017",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -327,7 +302,6 @@
|
||||
{
|
||||
"nth": 24,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2018",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -338,7 +312,6 @@
|
||||
{
|
||||
"nth": 25,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2019",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -349,7 +322,6 @@
|
||||
{
|
||||
"nth": 26,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "201A",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -360,7 +332,6 @@
|
||||
{
|
||||
"nth": 27,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "201B",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -371,7 +342,6 @@
|
||||
{
|
||||
"nth": 28,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "201C",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -382,7 +352,6 @@
|
||||
{
|
||||
"nth": 29,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "201D",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -393,7 +362,6 @@
|
||||
{
|
||||
"nth": 30,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "201E",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -404,7 +372,6 @@
|
||||
{
|
||||
"nth": 31,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "201F",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -415,7 +382,6 @@
|
||||
{
|
||||
"nth": 32,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2020",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -426,7 +392,6 @@
|
||||
{
|
||||
"nth": 33,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2021",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -437,7 +402,6 @@
|
||||
{
|
||||
"nth": 34,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2022",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -448,7 +412,6 @@
|
||||
{
|
||||
"nth": 35,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2023",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -459,7 +422,6 @@
|
||||
{
|
||||
"nth": 36,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2024",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -470,7 +432,6 @@
|
||||
{
|
||||
"nth": 37,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "2025",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
@@ -481,7 +442,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "31",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt64"
|
||||
@@ -492,7 +452,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "32",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt64"
|
||||
@@ -503,7 +462,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "33",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt64"
|
||||
@@ -514,7 +472,6 @@
|
||||
{
|
||||
"nth": 4,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "34",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt64"
|
||||
@@ -525,7 +482,6 @@
|
||||
{
|
||||
"nth": 5,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "35",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt64"
|
||||
@@ -536,7 +492,6 @@
|
||||
{
|
||||
"nth": 6,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "36",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt64"
|
||||
@@ -547,7 +502,6 @@
|
||||
{
|
||||
"nth": 7,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "37",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt64"
|
||||
@@ -558,7 +512,6 @@
|
||||
{
|
||||
"nth": 8,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "38",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt64"
|
||||
@@ -569,7 +522,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "41",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash128"
|
||||
@@ -580,7 +532,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "51",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -591,7 +542,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "52",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -602,7 +552,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "53",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -613,7 +562,6 @@
|
||||
{
|
||||
"nth": 4,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "54",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -624,7 +572,6 @@
|
||||
{
|
||||
"nth": 5,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "55",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -635,7 +582,6 @@
|
||||
{
|
||||
"nth": 6,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "56",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -646,7 +592,6 @@
|
||||
{
|
||||
"nth": 7,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "57",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -657,7 +602,6 @@
|
||||
{
|
||||
"nth": 8,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "58",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -668,7 +612,6 @@
|
||||
{
|
||||
"nth": 9,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "59",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -679,7 +622,6 @@
|
||||
{
|
||||
"nth": 16,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "5010",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -690,7 +632,6 @@
|
||||
{
|
||||
"nth": 17,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "5011",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -701,7 +642,6 @@
|
||||
{
|
||||
"nth": 18,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "5012",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -712,7 +652,6 @@
|
||||
{
|
||||
"nth": 19,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "5013",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -723,7 +662,6 @@
|
||||
{
|
||||
"nth": 20,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "5014",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -734,7 +672,6 @@
|
||||
{
|
||||
"nth": 21,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "5015",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash256"
|
||||
@@ -745,7 +682,6 @@
|
||||
{
|
||||
"nth": 257,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "5001",
|
||||
"isSerialized": false,
|
||||
"isSigningField": false,
|
||||
"type": "Hash256"
|
||||
@@ -756,7 +692,6 @@
|
||||
{
|
||||
"nth": 258,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "5002",
|
||||
"isSerialized": false,
|
||||
"isSigningField": false,
|
||||
"type": "Hash256"
|
||||
@@ -767,7 +702,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "61",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -778,7 +712,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "62",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -789,7 +722,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "63",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -800,7 +732,6 @@
|
||||
{
|
||||
"nth": 4,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "64",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -811,7 +742,6 @@
|
||||
{
|
||||
"nth": 5,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "65",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -822,7 +752,6 @@
|
||||
{
|
||||
"nth": 6,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "66",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -833,7 +762,6 @@
|
||||
{
|
||||
"nth": 7,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "67",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -844,7 +772,6 @@
|
||||
{
|
||||
"nth": 8,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "68",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -855,7 +782,6 @@
|
||||
{
|
||||
"nth": 9,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "69",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -866,7 +792,6 @@
|
||||
{
|
||||
"nth": 10,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "6A",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -877,7 +802,6 @@
|
||||
{
|
||||
"nth": 16,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "6010",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -888,7 +812,6 @@
|
||||
{
|
||||
"nth": 17,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "6011",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -899,7 +822,6 @@
|
||||
{
|
||||
"nth": 18,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "6012",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Amount"
|
||||
@@ -910,7 +832,6 @@
|
||||
{
|
||||
"nth": 258,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "6002",
|
||||
"isSerialized": false,
|
||||
"isSigningField": false,
|
||||
"type": "Amount"
|
||||
@@ -921,7 +842,6 @@
|
||||
{
|
||||
"nth": 259,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "6003",
|
||||
"isSerialized": false,
|
||||
"isSigningField": false,
|
||||
"type": "Amount"
|
||||
@@ -932,7 +852,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "71",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -943,7 +862,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "72",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -954,7 +872,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "73",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -965,7 +882,6 @@
|
||||
{
|
||||
"nth": 4,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "74",
|
||||
"isSerialized": true,
|
||||
"isSigningField": false,
|
||||
"type": "Blob"
|
||||
@@ -976,7 +892,6 @@
|
||||
{
|
||||
"nth": 5,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "75",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -987,7 +902,6 @@
|
||||
{
|
||||
"nth": 6,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "76",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -998,7 +912,6 @@
|
||||
{
|
||||
"nth": 7,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "77",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -1009,7 +922,6 @@
|
||||
{
|
||||
"nth": 8,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "78",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -1020,7 +932,6 @@
|
||||
{
|
||||
"nth": 9,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "79",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -1031,7 +942,6 @@
|
||||
{
|
||||
"nth": 10,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "7A",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -1042,7 +952,6 @@
|
||||
{
|
||||
"nth": 11,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "7B",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -1053,7 +962,6 @@
|
||||
{
|
||||
"nth": 12,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "7C",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -1064,7 +972,6 @@
|
||||
{
|
||||
"nth": 13,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "7D",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -1075,7 +982,6 @@
|
||||
{
|
||||
"nth": 14,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "7E",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -1086,7 +992,6 @@
|
||||
{
|
||||
"nth": 17,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "7011",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Blob"
|
||||
@@ -1097,7 +1002,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "81",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "AccountID"
|
||||
@@ -1108,7 +1012,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "82",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "AccountID"
|
||||
@@ -1119,7 +1022,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "83",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "AccountID"
|
||||
@@ -1130,7 +1032,6 @@
|
||||
{
|
||||
"nth": 4,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "84",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "AccountID"
|
||||
@@ -1141,7 +1042,6 @@
|
||||
{
|
||||
"nth": 7,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "87",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "AccountID"
|
||||
@@ -1152,7 +1052,6 @@
|
||||
{
|
||||
"nth": 8,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "88",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "AccountID"
|
||||
@@ -1163,7 +1062,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E1",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1174,7 +1072,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E2",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1185,7 +1082,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E3",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1196,7 +1092,6 @@
|
||||
{
|
||||
"nth": 4,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E4",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1207,7 +1102,6 @@
|
||||
{
|
||||
"nth": 5,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E5",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1218,7 +1112,6 @@
|
||||
{
|
||||
"nth": 6,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E6",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1229,7 +1122,6 @@
|
||||
{
|
||||
"nth": 7,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E7",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1240,7 +1132,6 @@
|
||||
{
|
||||
"nth": 8,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E8",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1251,7 +1142,6 @@
|
||||
{
|
||||
"nth": 9,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E9",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1262,7 +1152,6 @@
|
||||
{
|
||||
"nth": 10,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "EA",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1273,7 +1162,6 @@
|
||||
{
|
||||
"nth": 11,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "EB",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1284,7 +1172,16 @@
|
||||
{
|
||||
"nth": 16,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "E010",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
}
|
||||
],
|
||||
[
|
||||
"Majority",
|
||||
{
|
||||
"nth": 18,
|
||||
"isVLEncoded": false,
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STObject"
|
||||
@@ -1295,7 +1192,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "F1",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STArray"
|
||||
@@ -1306,7 +1202,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "F3",
|
||||
"isSerialized": true,
|
||||
"isSigningField": false,
|
||||
"type": "STArray"
|
||||
@@ -1317,7 +1212,6 @@
|
||||
{
|
||||
"nth": 4,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "F4",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STArray"
|
||||
@@ -1328,7 +1222,6 @@
|
||||
{
|
||||
"nth": 5,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "F5",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STArray"
|
||||
@@ -1339,7 +1232,6 @@
|
||||
{
|
||||
"nth": 6,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "F6",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STArray"
|
||||
@@ -1350,7 +1242,6 @@
|
||||
{
|
||||
"nth": 7,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "F7",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STArray"
|
||||
@@ -1361,7 +1252,6 @@
|
||||
{
|
||||
"nth": 8,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "F8",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STArray"
|
||||
@@ -1372,7 +1262,16 @@
|
||||
{
|
||||
"nth": 9,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "F9",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STArray"
|
||||
}
|
||||
],
|
||||
[
|
||||
"Majorities",
|
||||
{
|
||||
"nth": 16,
|
||||
"isVLEncoded": false,
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "STArray"
|
||||
@@ -1383,7 +1282,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0110",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt8"
|
||||
@@ -1394,7 +1292,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0210",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt8"
|
||||
@@ -1405,7 +1302,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0310",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt8"
|
||||
@@ -1416,7 +1312,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0111",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash160"
|
||||
@@ -1427,7 +1322,6 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0211",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash160"
|
||||
@@ -1438,7 +1332,6 @@
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0311",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash160"
|
||||
@@ -1449,7 +1342,6 @@
|
||||
{
|
||||
"nth": 4,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0411",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Hash160"
|
||||
@@ -1460,7 +1352,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0112",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "PathSet"
|
||||
@@ -1471,7 +1362,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "0113",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Vector256"
|
||||
@@ -1482,18 +1372,16 @@
|
||||
{
|
||||
"nth": 2,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "0213",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Vector256"
|
||||
}
|
||||
],
|
||||
[
|
||||
"Features",
|
||||
"Amendments",
|
||||
{
|
||||
"nth": 3,
|
||||
"isVLEncoded": true,
|
||||
"bytes": "0313",
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "Vector256"
|
||||
@@ -1504,7 +1392,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0111",
|
||||
"isSerialized": false,
|
||||
"isSigningField": false,
|
||||
"type": "Transaction"
|
||||
@@ -1515,7 +1402,6 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0112",
|
||||
"isSerialized": false,
|
||||
"isSigningField": false,
|
||||
"type": "LedgerEntry"
|
||||
@@ -1526,14 +1412,12 @@
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"bytes": "0113",
|
||||
"isSerialized": false,
|
||||
"isSigningField": false,
|
||||
"type": "Validation"
|
||||
}
|
||||
]
|
||||
],
|
||||
"date-generated": "Fri Sep 11 11:35:38 ICT 2015",
|
||||
"TRANSACTION_RESULTS": {
|
||||
"tecINSUFFICIENT_RESERVE": 141,
|
||||
"telNO_DST_PARTIAL": -393,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const _ = require('lodash');
|
||||
const {parseBytes, serializeUIntN} = require('./../utils/bytes-utils');
|
||||
@@ -102,7 +100,7 @@ Enums.Field = makeClass({
|
||||
const extra = {ordinal, name, type, bytes};
|
||||
return new this(_.assign(definition, extra));
|
||||
});
|
||||
return _.indexBy(fields, 'name');
|
||||
return _.keyBy(fields, 'name');
|
||||
},
|
||||
header(type, nth) {
|
||||
const name = nth;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const {serializeUIntN} = require('./utils/bytes-utils');
|
||||
|
||||
function bytes(uint32) {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('./utils/make-class');
|
||||
const {HashPrefix} = require('./hash-prefixes');
|
||||
const {Hash256} = require('./types');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const coreTypes = require('./coretypes');
|
||||
const {quality,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const BN = require('bn.js');
|
||||
const assert = require('assert');
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
'use strict';
|
||||
const Decimal = require('decimal.js');
|
||||
const {bytesToHex, slice, parseBytes} = require('./utils/bytes-utils');
|
||||
const {UInt64} = require('./types');
|
||||
@@ -16,7 +15,7 @@ module.exports = {
|
||||
decode(arg) {
|
||||
const bytes = slice(parseBytes(arg), -8);
|
||||
const exponent = bytes[0] - 100;
|
||||
const mantissa = new Decimal(bytesToHex(slice(bytes, 1)), 16);
|
||||
const mantissa = new Decimal('0x' + bytesToHex(slice(bytes, 1)));
|
||||
return mantissa.times('1e' + exponent);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {Field} = require('../enums');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const {parseBytes, bytesToHex} = require('../utils/bytes-utils');
|
||||
const makeClass = require('../utils/make-class');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const makeClass = require('./utils/make-class');
|
||||
const {Hash256} = require('./types');
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
'use strict';
|
||||
/* eslint-disable func-style */
|
||||
|
||||
const _ = require('lodash');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {decodeAccountID, encodeAccountID} = require('ripple-address-codec');
|
||||
const {Hash160} = require('./hash-160');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const assert = require('assert');
|
||||
const BN = require('bn.js');
|
||||
@@ -58,7 +56,7 @@ const Amount = makeClass({
|
||||
|
||||
const isIOU = b1 & 0x80;
|
||||
const isPositive = b1 & 0x40;
|
||||
const sign = isPositive ? '+' : '-';
|
||||
const sign = isPositive ? '' : '-';
|
||||
|
||||
if (isIOU) {
|
||||
mantissa[0] = 0;
|
||||
@@ -67,13 +65,13 @@ const Amount = makeClass({
|
||||
const exponent = ((b1 & 0x3F) << 2) + ((b2 & 0xff) >> 6) - 97;
|
||||
mantissa[1] &= 0x3F;
|
||||
// decimal.js won't accept e notation with hex
|
||||
const value = new Decimal(sign + bytesToHex(mantissa), 16)
|
||||
const value = new Decimal(`${sign}0x${bytesToHex(mantissa)}`)
|
||||
.times('1e' + exponent);
|
||||
return new this(value, currency, issuer);
|
||||
}
|
||||
|
||||
mantissa[0] &= 0x3F;
|
||||
const drops = new Decimal(sign + bytesToHex(mantissa), 16);
|
||||
const drops = new Decimal(`${sign}0x${bytesToHex(mantissa)}`);
|
||||
const xrpValue = drops.dividedBy('1e6');
|
||||
return new this(xrpValue, Currency.XRP);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {parseBytes} = require('../utils/bytes-utils');
|
||||
const {SerializedType} = require('./serialized-type');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {slice} = require('../utils/bytes-utils');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {Hash} = require('./hash');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {Hash} = require('./hash');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {Hash} = require('./hash');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {Comparable, SerializedType} = require('./serialized-type');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const enums = require('../enums');
|
||||
const {Field} = enums;
|
||||
const {AccountID} = require('./account-id');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const {bytesToHex, slice} = require('../utils/bytes-utils');
|
||||
const {BytesList} = require('../serdes/binary-serializer');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {ensureArrayLikeIs, SerializedType} = require('./serialized-type');
|
||||
const {Field} = require('../enums');
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
'use strict';
|
||||
|
||||
// const assert = require('assert');
|
||||
const assert = require('assert');
|
||||
const _ = require('lodash');
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {Field} = require('../enums');
|
||||
@@ -44,9 +42,11 @@ const STObject = makeClass({
|
||||
return Object.keys(this).map((k) => Field[k]).filter(Boolean);
|
||||
},
|
||||
toJSON() {
|
||||
// Otherwise seemingly result will have same prototype as `this`
|
||||
const accumulator = {}; // of only `own` properties
|
||||
return _.transform(this, (result, value, key) => {
|
||||
result[key] = value && value.toJSON ? value.toJSON() : value;
|
||||
});
|
||||
}, accumulator);
|
||||
},
|
||||
toBytesSink(sink, filter = () => true) {
|
||||
const serializer = new BinarySerializer(sink);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {UInt} = require('./uint');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {UInt} = require('./uint');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const BN = require('bn.js');
|
||||
const makeClass = require('../utils/make-class');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {UInt} = require('./uint');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const BN = require('bn.js');
|
||||
const makeClass = require('../utils/make-class');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const makeClass = require('../utils/make-class');
|
||||
const {Hash256} = require('./hash-256');
|
||||
const {ensureArrayLikeIs, SerializedType} = require('./serialized-type');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
function signum(a, b) {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const inherits = require('inherits');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert-diff');
|
||||
const {Amount} = require('../src/coretypes');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const fixtures = require('./fixtures/codec-fixtures.json');
|
||||
const {decode, encode} = require('../src');
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/* eslint-disable func-style */
|
||||
|
||||
'use strict';
|
||||
|
||||
const coreTypes = require('../src/coretypes');
|
||||
|
||||
const _ = require('lodash');
|
||||
@@ -157,11 +155,19 @@ function transactionParsingTests() {
|
||||
}
|
||||
assert(parser.end());
|
||||
});
|
||||
|
||||
it('can be done with higher level apis', () => {
|
||||
const parser = makeParser(transaction.binary);
|
||||
const jsonFromBinary = readJSON(parser);
|
||||
assert.deepEqual(jsonFromBinary, tx_json);
|
||||
});
|
||||
|
||||
it('readJSON (binary.decode) does not return STObject ', () => {
|
||||
const parser = makeParser(transaction.binary);
|
||||
const jsonFromBinary = readJSON(parser);
|
||||
assert((jsonFromBinary instanceof coreTypes.STObject) === false);
|
||||
assert(_.isPlainObject(jsonFromBinary));
|
||||
});
|
||||
}
|
||||
|
||||
function amountParsingTests() {
|
||||
@@ -322,35 +328,8 @@ function pathSetBinaryTests() {
|
||||
});
|
||||
}
|
||||
|
||||
function parseLedger4320278() {
|
||||
let ripple = require('ripple-lib');
|
||||
if (ripple._DEPRECATED) {
|
||||
ripple = ripple._DEPRECATED;
|
||||
}
|
||||
ripple.Amount.strict_mode = false;
|
||||
ripple = false;
|
||||
|
||||
it(`can parse object`, () => {
|
||||
this.timeout(30e3);
|
||||
const json = loadFixture('as-ledger-4320278.json');
|
||||
|
||||
json.forEach((e, i) => {
|
||||
const expected = e.json;
|
||||
const actual = readJSON(makeParser(e.binary));
|
||||
actual.index = expected.index;
|
||||
// const actual = new ripple.SerializedObject(e.binary).to_json();
|
||||
try {
|
||||
assert.deepEqual(actual, expected);
|
||||
} catch (error) {
|
||||
console.log('error', i, !ripple && error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
describe('BinaryParser', function() {
|
||||
function dataDrivenTests() {
|
||||
describe.skip('as-ledger-4320278.json', parseLedger4320278);
|
||||
describe('Amount parsing tests', amountParsingTests);
|
||||
describe('Field Tests', fieldParsingTests);
|
||||
describe('Parsing nested objects', nestedObjectTests);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/* eslint-disable func-style */
|
||||
|
||||
'use strict';
|
||||
|
||||
const BN = require('bn.js');
|
||||
const assert = require('assert-diff');
|
||||
const lib = require('../src/coretypes');
|
||||
@@ -78,7 +76,7 @@ function UIntTest() {
|
||||
|
||||
|
||||
function parseLedger4320278() {
|
||||
it(`can parse object`, done => {
|
||||
it('can parse object', done => {
|
||||
this.timeout(30e3);
|
||||
const json = loadFixture('as-ledger-4320278.json');
|
||||
json.forEach(e => {
|
||||
@@ -89,7 +87,7 @@ function parseLedger4320278() {
|
||||
}
|
||||
|
||||
function deliverMinTest() {
|
||||
it(`can serialize DeliverMin`, () => {
|
||||
it('can serialize DeliverMin', () => {
|
||||
assert.strictEqual(encode(deliverMinTx), deliverMinTxBinary);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const bytesUtils = require('../src/utils/bytes-utils');
|
||||
const {slice, compareBytes, parseBytes, bytesToHex} = bytesUtils;
|
||||
|
||||
@@ -926,7 +926,7 @@
|
||||
},
|
||||
{
|
||||
"type_name": "Vector256",
|
||||
"name": "Features",
|
||||
"name": "Amendments",
|
||||
"nth_of_type": 3,
|
||||
"type": 19,
|
||||
"expected_hex": "0313"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert-diff');
|
||||
const {Hash160, Hash256, Currency, AccountID} = require('../src/coretypes');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const {loadFixture} = require('./utils');
|
||||
const ledgerHashes = require('../src/ledger-hashes');
|
||||
|
||||
@@ -1 +1 @@
|
||||
--reporter spec --slow 500 --compilers js:babel/register
|
||||
--reporter spec --slow 500 --compilers js:babel-register
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert-diff');
|
||||
const {quality, binary: {bytesToHex}} = require('../src/coretypes');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert-diff');
|
||||
const {ShaMap} = require('../src/shamap.js');
|
||||
const {binary: {serializeObject}, Hash256, HashPrefix}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const assert = require('assert-diff');
|
||||
const {encodeForSigning, encodeForMultisigning} = require('../src');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const assert = require('assert');
|
||||
const coreTypes = require('../src/types');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const coreTypes = require('../src/coretypes');
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
const intercept = require('intercept-stdout');
|
||||
const fs = require('fs');
|
||||
const fsExtra = require('fs-extra');
|
||||
|
||||
Reference in New Issue
Block a user