Przeglądaj źródła

Fix broken test case

master
nitowa 2 lat temu
rodzic
commit
3cc3d739af
4 zmienionych plików z 247 dodań i 55 usunięć
  1. 0
    16
      getTestnetWallet.js
  2. 223
    17
      package-lock.json
  3. 4
    2
      src/xrpIO/ripple-binding.ts
  4. 20
    20
      test/primitives.ts

+ 0
- 16
getTestnetWallet.js Wyświetl plik

@@ -1,16 +0,0 @@
1
-const fetch = require('node-fetch')
2
-  const rawResponse = fetch('https://faucet.altnet.rippletest.net/accounts', {
3
-    method: 'POST',
4
-    headers: {
5
-      'Accept': 'application/json',
6
-      'Content-Type': 'application/json'
7
-    },
8
-  }).then(raw => {
9
-      raw.json().then(content => {
10
-        console.log ({
11
-            secret: content.account.secret,
12
-            address: content.account.address
13
-          });
14
-      })
15
-  });
16
-

+ 223
- 17
package-lock.json Wyświetl plik

@@ -19,8 +19,7 @@
19 19
     "@types/chai": {
20 20
       "version": "4.2.21",
21 21
       "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.21.tgz",
22
-      "integrity": "sha512-yd+9qKmJxm496BOV9CMNaey8TWsikaZOwMRwPHQIjcOJM9oV+fi9ZMNw3JsVnbEEbo2gRTDnGEBv8pjyn67hNg==",
23
-      "dev": true
22
+      "integrity": "sha512-yd+9qKmJxm496BOV9CMNaey8TWsikaZOwMRwPHQIjcOJM9oV+fi9ZMNw3JsVnbEEbo2gRTDnGEBv8pjyn67hNg=="
24 23
     },
25 24
     "@types/eslint": {
26 25
       "version": "7.2.8",
@@ -59,11 +58,16 @@
59 58
       "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz",
60 59
       "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q=="
61 60
     },
61
+    "@types/minimatch": {
62
+      "version": "3.0.3",
63
+      "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
64
+      "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
65
+      "dev": true
66
+    },
62 67
     "@types/mocha": {
63 68
       "version": "8.2.2",
64 69
       "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.2.tgz",
65
-      "integrity": "sha512-Lwh0lzzqT5Pqh6z61P3c3P5nm6fzQK/MMHl9UKeneAeInVflBSz1O2EkX6gM6xfJd7FBXBY5purtLx7fUiZ7Hw==",
66
-      "dev": true
70
+      "integrity": "sha512-Lwh0lzzqT5Pqh6z61P3c3P5nm6fzQK/MMHl9UKeneAeInVflBSz1O2EkX6gM6xfJd7FBXBY5purtLx7fUiZ7Hw=="
67 71
     },
68 72
     "@types/node": {
69 73
       "version": "14.14.37",
@@ -377,7 +381,12 @@
377 381
     "assertion-error": {
378 382
       "version": "1.1.0",
379 383
       "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
380
-      "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
384
+      "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw=="
385
+    },
386
+    "at-least-node": {
387
+      "version": "1.0.0",
388
+      "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
389
+      "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
381 390
       "dev": true
382 391
     },
383 392
     "available-typed-arrays": {
@@ -388,6 +397,15 @@
388 397
         "array-filter": "^1.0.0"
389 398
       }
390 399
     },
400
+    "backbone": {
401
+      "version": "1.4.0",
402
+      "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz",
403
+      "integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==",
404
+      "dev": true,
405
+      "requires": {
406
+        "underscore": ">=1.8.3"
407
+      }
408
+    },
391 409
     "balanced-match": {
392 410
       "version": "1.0.0",
393 411
       "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@@ -610,7 +628,6 @@
610 628
       "version": "4.3.4",
611 629
       "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz",
612 630
       "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==",
613
-      "dev": true,
614 631
       "requires": {
615 632
         "assertion-error": "^1.1.0",
616 633
         "check-error": "^1.0.2",
@@ -633,8 +650,7 @@
633 650
     "check-error": {
634 651
       "version": "1.0.2",
635 652
       "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
636
-      "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=",
637
-      "dev": true
653
+      "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII="
638 654
     },
639 655
     "chokidar": {
640 656
       "version": "3.5.1",
@@ -862,7 +878,6 @@
862 878
       "version": "3.0.1",
863 879
       "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
864 880
       "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
865
-      "dev": true,
866 881
       "requires": {
867 882
         "type-detect": "^4.0.0"
868 883
       }
@@ -1159,6 +1174,17 @@
1159 1174
       "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
1160 1175
       "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k="
1161 1176
     },
1177
+    "fs-extra": {
1178
+      "version": "8.1.0",
1179
+      "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
1180
+      "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
1181
+      "dev": true,
1182
+      "requires": {
1183
+        "graceful-fs": "^4.2.0",
1184
+        "jsonfile": "^4.0.0",
1185
+        "universalify": "^0.1.0"
1186
+      }
1187
+    },
1162 1188
     "fs.realpath": {
1163 1189
       "version": "1.0.0",
1164 1190
       "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -1186,8 +1212,7 @@
1186 1212
     "get-func-name": {
1187 1213
       "version": "2.0.0",
1188 1214
       "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
1189
-      "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=",
1190
-      "dev": true
1215
+      "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE="
1191 1216
     },
1192 1217
     "get-intrinsic": {
1193 1218
       "version": "1.1.1",
@@ -1255,6 +1280,19 @@
1255 1280
         "duplexer": "^0.1.2"
1256 1281
       }
1257 1282
     },
1283
+    "handlebars": {
1284
+      "version": "4.7.7",
1285
+      "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz",
1286
+      "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==",
1287
+      "dev": true,
1288
+      "requires": {
1289
+        "minimist": "^1.2.5",
1290
+        "neo-async": "^2.6.0",
1291
+        "source-map": "^0.6.1",
1292
+        "uglify-js": "^3.1.4",
1293
+        "wordwrap": "^1.0.0"
1294
+      }
1295
+    },
1258 1296
     "has": {
1259 1297
       "version": "1.0.3",
1260 1298
       "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
@@ -1304,6 +1342,12 @@
1304 1342
       "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
1305 1343
       "dev": true
1306 1344
     },
1345
+    "highlight.js": {
1346
+      "version": "9.18.5",
1347
+      "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.5.tgz",
1348
+      "integrity": "sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA==",
1349
+      "dev": true
1350
+    },
1307 1351
     "hmac-drbg": {
1308 1352
       "version": "1.0.1",
1309 1353
       "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
@@ -1549,6 +1593,12 @@
1549 1593
         "supports-color": "^7.0.0"
1550 1594
       }
1551 1595
     },
1596
+    "jquery": {
1597
+      "version": "3.6.0",
1598
+      "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
1599
+      "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==",
1600
+      "dev": true
1601
+    },
1552 1602
     "js-yaml": {
1553 1603
       "version": "4.0.0",
1554 1604
       "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz",
@@ -1579,6 +1629,15 @@
1579 1629
         "minimist": "^1.2.5"
1580 1630
       }
1581 1631
     },
1632
+    "jsonfile": {
1633
+      "version": "4.0.0",
1634
+      "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
1635
+      "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
1636
+      "dev": true,
1637
+      "requires": {
1638
+        "graceful-fs": "^4.1.6"
1639
+      }
1640
+    },
1582 1641
     "jsonschema": {
1583 1642
       "version": "1.2.2",
1584 1643
       "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.2.tgz",
@@ -1644,6 +1703,18 @@
1644 1703
         "yallist": "^4.0.0"
1645 1704
       }
1646 1705
     },
1706
+    "lunr": {
1707
+      "version": "2.3.9",
1708
+      "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
1709
+      "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==",
1710
+      "dev": true
1711
+    },
1712
+    "marked": {
1713
+      "version": "0.8.2",
1714
+      "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz",
1715
+      "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==",
1716
+      "dev": true
1717
+    },
1647 1718
     "md5.js": {
1648 1719
       "version": "1.3.5",
1649 1720
       "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
@@ -1880,8 +1951,7 @@
1880 1951
     "node-fetch": {
1881 1952
       "version": "2.6.1",
1882 1953
       "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
1883
-      "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
1884
-      "dev": true
1954
+      "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
1885 1955
     },
1886 1956
     "node-releases": {
1887 1957
       "version": "1.1.71",
@@ -2033,8 +2103,7 @@
2033 2103
     "pathval": {
2034 2104
       "version": "1.1.1",
2035 2105
       "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz",
2036
-      "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==",
2037
-      "dev": true
2106
+      "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ=="
2038 2107
     },
2039 2108
     "pbkdf2": {
2040 2109
       "version": "3.1.1",
@@ -2076,6 +2145,12 @@
2076 2145
       "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
2077 2146
       "dev": true
2078 2147
     },
2148
+    "progress": {
2149
+      "version": "2.0.3",
2150
+      "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
2151
+      "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
2152
+      "dev": true
2153
+    },
2079 2154
     "prr": {
2080 2155
       "version": "1.0.1",
2081 2156
       "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
@@ -2332,6 +2407,34 @@
2332 2407
       "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
2333 2408
       "dev": true
2334 2409
     },
2410
+    "shelljs": {
2411
+      "version": "0.8.5",
2412
+      "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz",
2413
+      "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==",
2414
+      "dev": true,
2415
+      "requires": {
2416
+        "glob": "^7.0.0",
2417
+        "interpret": "^1.0.0",
2418
+        "rechoir": "^0.6.2"
2419
+      },
2420
+      "dependencies": {
2421
+        "interpret": {
2422
+          "version": "1.4.0",
2423
+          "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
2424
+          "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
2425
+          "dev": true
2426
+        },
2427
+        "rechoir": {
2428
+          "version": "0.6.2",
2429
+          "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
2430
+          "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
2431
+          "dev": true,
2432
+          "requires": {
2433
+            "resolve": "^1.1.6"
2434
+          }
2435
+        }
2436
+      }
2437
+    },
2335 2438
     "signal-exit": {
2336 2439
       "version": "3.0.3",
2337 2440
       "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
@@ -2532,8 +2635,86 @@
2532 2635
     "type-detect": {
2533 2636
       "version": "4.0.8",
2534 2637
       "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
2535
-      "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
2536
-      "dev": true
2638
+      "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g=="
2639
+    },
2640
+    "typedoc": {
2641
+      "version": "0.15.8",
2642
+      "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.8.tgz",
2643
+      "integrity": "sha512-a0zypcvfIFsS7Gqpf2MkC1+jNND3K1Om38pbDdy/gYWX01NuJZhC5+O0HkIp0oRIZOo7PWrA5+fC24zkANY28Q==",
2644
+      "dev": true,
2645
+      "requires": {
2646
+        "@types/minimatch": "3.0.3",
2647
+        "fs-extra": "^8.1.0",
2648
+        "handlebars": "^4.7.0",
2649
+        "highlight.js": "^9.17.1",
2650
+        "lodash": "^4.17.15",
2651
+        "marked": "^0.8.0",
2652
+        "minimatch": "^3.0.0",
2653
+        "progress": "^2.0.3",
2654
+        "shelljs": "^0.8.3",
2655
+        "typedoc-default-themes": "^0.6.3",
2656
+        "typescript": "3.7.x"
2657
+      },
2658
+      "dependencies": {
2659
+        "typescript": {
2660
+          "version": "3.7.7",
2661
+          "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.7.tgz",
2662
+          "integrity": "sha512-MmQdgo/XenfZPvVLtKZOq9jQQvzaUAUpcKW8Z43x9B2fOm4S5g//tPtMweZUIP+SoBqrVPEIm+dJeQ9dfO0QdA==",
2663
+          "dev": true
2664
+        }
2665
+      }
2666
+    },
2667
+    "typedoc-default-themes": {
2668
+      "version": "0.6.3",
2669
+      "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.6.3.tgz",
2670
+      "integrity": "sha512-rouf0TcIA4M2nOQFfC7Zp4NEwoYiEX4vX/ZtudJWU9IHA29MPC+PPgSXYLPESkUo7FuB//GxigO3mk9Qe1xp3Q==",
2671
+      "dev": true,
2672
+      "requires": {
2673
+        "backbone": "^1.4.0",
2674
+        "jquery": "^3.4.1",
2675
+        "lunr": "^2.3.8",
2676
+        "underscore": "^1.9.1"
2677
+      }
2678
+    },
2679
+    "typedoc-plugin-markdown": {
2680
+      "version": "2.4.2",
2681
+      "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-2.4.2.tgz",
2682
+      "integrity": "sha512-BBH+9/Uq5XbsqfzCDl8Jq4iaLXRMXRuAHZRFarAZX7df8+F3vUjDx/WHWoWqbZ/XUFzduLC2Iuy2qwsJX8SQ7A==",
2683
+      "dev": true,
2684
+      "requires": {
2685
+        "fs-extra": "^9.0.1",
2686
+        "handlebars": "^4.7.6"
2687
+      },
2688
+      "dependencies": {
2689
+        "fs-extra": {
2690
+          "version": "9.1.0",
2691
+          "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
2692
+          "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
2693
+          "dev": true,
2694
+          "requires": {
2695
+            "at-least-node": "^1.0.0",
2696
+            "graceful-fs": "^4.2.0",
2697
+            "jsonfile": "^6.0.1",
2698
+            "universalify": "^2.0.0"
2699
+          }
2700
+        },
2701
+        "jsonfile": {
2702
+          "version": "6.1.0",
2703
+          "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
2704
+          "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
2705
+          "dev": true,
2706
+          "requires": {
2707
+            "graceful-fs": "^4.1.6",
2708
+            "universalify": "^2.0.0"
2709
+          }
2710
+        },
2711
+        "universalify": {
2712
+          "version": "2.0.0",
2713
+          "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
2714
+          "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
2715
+          "dev": true
2716
+        }
2717
+      }
2537 2718
     },
2538 2719
     "typescript": {
2539 2720
       "version": "3.9.9",
@@ -2541,6 +2722,13 @@
2541 2722
       "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==",
2542 2723
       "dev": true
2543 2724
     },
2725
+    "uglify-js": {
2726
+      "version": "3.15.0",
2727
+      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.0.tgz",
2728
+      "integrity": "sha512-x+xdeDWq7FiORDvyIJ0q/waWd4PhjBNOm5dQUOq2AKC0IEjxOS66Ha9tctiVDGcRQuh69K7fgU5oRuTK4cysSg==",
2729
+      "dev": true,
2730
+      "optional": true
2731
+    },
2544 2732
     "unbox-primitive": {
2545 2733
       "version": "1.0.1",
2546 2734
       "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
@@ -2552,6 +2740,18 @@
2552 2740
         "which-boxed-primitive": "^1.0.2"
2553 2741
       }
2554 2742
     },
2743
+    "underscore": {
2744
+      "version": "1.13.2",
2745
+      "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz",
2746
+      "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==",
2747
+      "dev": true
2748
+    },
2749
+    "universalify": {
2750
+      "version": "0.1.2",
2751
+      "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
2752
+      "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
2753
+      "dev": true
2754
+    },
2555 2755
     "uri-js": {
2556 2756
       "version": "4.4.1",
2557 2757
       "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
@@ -2757,6 +2957,12 @@
2757 2957
       "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==",
2758 2958
       "dev": true
2759 2959
     },
2960
+    "wordwrap": {
2961
+      "version": "1.0.0",
2962
+      "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
2963
+      "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
2964
+      "dev": true
2965
+    },
2760 2966
     "workerpool": {
2761 2967
       "version": "6.1.0",
2762 2968
       "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz",

+ 4
- 2
src/xrpIO/ripple-binding.ts Wyświetl plik

@@ -1,9 +1,11 @@
1
-import { Instructions, LedgerClosedEvent, RippleAPI } from 'ripple-lib'
2 1
 import { Memo, Wallet } from '../util/types'
3 2
 import { MIN_XRP_FEE, MIN_XRP_TX_VALUE } from '../util/protocol.constants';
3
+
4
+import { Instructions, LedgerClosedEvent, RippleAPI } from 'ripple-lib'
5
+import { Payment } from 'ripple-lib/dist/npm/transaction/payment';
6
+
4 7
 import * as zlib from 'zlib'
5 8
 import * as util from 'util'
6
-import { Payment } from 'ripple-lib/dist/npm/transaction/payment';
7 9
 
8 10
 const chunkString = (str: string, length: number) => str.match(new RegExp('.{1,' + length + '}', 'gs'));
9 11
 const PAYLOAD_SIZE = 925

+ 20
- 20
test/primitives.ts Wyświetl plik

@@ -7,8 +7,8 @@ const utf8 = require('utf8')
7 7
 const base64 = require('base-64')
8 8
 const expect = chai.expect
9 9
 
10
-let sendWallet:Wallet
11
-let receiveWallet:Wallet
10
+let sendWallet: Wallet
11
+let receiveWallet: Wallet
12 12
 let api: RippleAPI
13 13
 
14 14
 describe('XRPIO', () => {
@@ -16,23 +16,23 @@ describe('XRPIO', () => {
16 16
         this.timeout(15000)
17 17
         sendWallet = await makeTestnetWallet()
18 18
         receiveWallet = await makeTestnetWallet()
19
-        await new Promise((res, rej) => setTimeout(res, 10000))
19
+        await new Promise((res, rej) => setTimeout(res, 10000)) //it takes a moment for the wallets to become active
20 20
     })
21
-    
21
+
22 22
     before(async () => {
23
-        try{
23
+        try {
24 24
             api = new RippleAPI({ server: TEST_CONFIG.rippleNode })
25 25
             return await api.connect()
26
-        }catch(e){
26
+        } catch (e) {
27 27
             console.log(e)
28 28
             throw e
29 29
         }
30 30
     })
31 31
 
32 32
     after(async function () {
33
-        try{
33
+        try {
34 34
             return await api.disconnect()
35
-        }catch(e){
35
+        } catch (e) {
36 36
             console.log(e)
37 37
         }
38 38
     })
@@ -48,9 +48,9 @@ describe('XRPIO', () => {
48 48
     })
49 49
 
50 50
     describe('payment', () => {
51
-        it('sendPayment', async function (){
51
+        it('sendPayment', async function () {
52 52
             this.timeout(10000)
53
-            const result = await sendPayment(api, [{data: "123"}], sendWallet.address, receiveWallet.address, sendWallet.secret, latestSeq+1)
53
+            const result = await sendPayment(api, [{ data: "123" }], sendWallet.address, receiveWallet.address, sendWallet.secret, latestSeq + 1)
54 54
             expect(result).to.exist
55 55
             expect(result.resultCode).to.be.equal('tesSUCCESS')
56 56
         })
@@ -58,31 +58,31 @@ describe('XRPIO', () => {
58 58
 
59 59
     describe('I/O', () => {
60 60
         let treeRoot
61
-        it(`can tree write (${TEST_DATA.length} bytes)`, async function (){
61
+        it(`can tree write (${TEST_DATA.length} bytes)`, async function () {
62 62
             this.timeout(10000)
63
-            treeRoot = await treeWrite(api, TEST_DATA, {address: "123", secret: "123"}, receiveWallet.address)
63
+            treeRoot = await treeWrite(api, TEST_DATA, sendWallet, receiveWallet.address)
64 64
         })
65
-    
66
-        it('can tree read', async function() {
65
+
66
+        it('can tree read', async function () {
67 67
             this.timeout(1500)
68 68
             const data = await treeRead(api, [treeRoot])
69 69
             expect(data).to.be.equal(TEST_DATA)
70 70
         })
71
-    
72
-        it(`can tree write large (${longText.length} bytes)`, async function (){
71
+
72
+        it(`can tree write large (${longText.length} bytes)`, async function () {
73 73
             this.timeout(30000)
74 74
             treeRoot = await treeWrite(api, longText, sendWallet, receiveWallet.address)
75 75
         })
76
-    
77
-        it('can tree read large', async function() {
76
+
77
+        it('can tree read large', async function () {
78 78
             this.timeout(3000)
79 79
             const data = await treeRead(api, [treeRoot])
80 80
             expect(data).to.be.equal(longText)
81 81
         })
82
-    
82
+
83 83
         it("can r/w binary", async function () {
84 84
             this.timeout(10000);
85
-    
85
+
86 86
             const bytes = utf8.encode(TEST_DATA)
87 87
             const encoded = base64.encode(bytes)
88 88
             const txHash = await treeWrite(api, encoded, sendWallet, receiveWallet.address)

Ładowanie…
Anuluj
Zapisz