diff --git a/.circleci/config.yml b/.circleci/config.yml index ab4bb74476..11317558a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,22 +7,20 @@ version: 2.0 jobs: install: <<: *defaults - docker: - - image: circleci/node:10.2 working_directory: ~/repo steps: - checkout - restore_cache: keys: - - v1-dependencies-{{ checksum "package.json" }} + - v1-dependencies-{{ checksum "package-lock.json" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: npm install - - run: npm install eslint istanbul@1.1.0-alpha.1 codecov + - run: npm install eslint babel-eslint istanbul@1.1.0-alpha.1 codecov - save_cache: paths: - node_modules - key: v1-dependencies-{{ checksum "package.json" }} + key: v1-dependencies-{{ checksum "package-lock.json" }} - persist_to_workspace: root: . paths: . diff --git a/.eslintrc.json b/.eslintrc.json index 7ce723f88a..4db51ca111 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,8 +4,53 @@ "node": true }, "extends": "eslint:recommended", + "globals": { + "Atomics": "readable", + "BigInt": "readable", + "BigInt64Array": "readable", + "BigUint64Array": "readable", + "queueMicrotask": "readable", + "SharedArrayBuffer": "readable", + "TextEncoder": "readable", + "TextDecoder": "readable" + }, + "overrides": [ + { + "files": ["*.mjs"], + "parserOptions": { + "sourceType": "module" + } + }, + { + "files": ["*.cjs"], + "parserOptions": { + "sourceType": "script" + } + }, + { + "files": [ + "test/{,**/}*.{mjs,cjs,js}" + ], + "env": { + "mocha": true + }, + "globals": { + "register": "readable" + }, + "rules": { + "max-len": "off", + "prefer-arrow-callback": "off" + } + } + ], + "parser": "babel-eslint", "parserOptions": { - "ecmaVersion": 9 + "ecmaVersion": 10, + "ecmaFeatures": { + "globalReturn": true + }, + "requireConfigFile": false, + "sourceType": "script" }, "root": true, "rules": { @@ -27,11 +72,20 @@ }], "func-name-matching": "error", "indent": ["off", 2, { + "ArrayExpression": "off", "SwitchCase": 1, "CallExpression": { "arguments": "off" }, - "ArrayExpression": "off" + "FunctionDeclaration": { + "parameters": "off" + }, + "FunctionExpression": { + "parameters": "off" + }, + "MemberExpression": "off", + "ObjectExpression": "off", + "ImportDeclaration": "off" }], "handle-callback-err": "off", "linebreak-style": ["error", "unix"], diff --git a/.gitignore b/.gitignore index baf2bb14d1..726ab8104a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ node_modules/ +.nyc_output docs/reference/ docker_data/ browser/bcoin* npm-debug.log coverage/ +yarn.lock +webpack.*.js diff --git a/.npmignore b/.npmignore index c93e8534fb..0d1166793e 100644 --- a/.npmignore +++ b/.npmignore @@ -1,9 +1,18 @@ +.babel* +.bmocharc* +.bpkgignore +.editorconfig +.eslint* .git* -bench/ -docs/ -docker_data/ -test/ +.mocharc* +.yarnignore +yarn.lock node_modules/ -browser/bcoin* package-lock.json npm-debug.log +webpack.*.js +browser/bcoin* +bench/ +build/ +docs/ +test/ diff --git a/bench/chacha.js b/bench/chacha.js deleted file mode 100644 index 02e38dac65..0000000000 --- a/bench/chacha.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -const ChaCha20 = require('bcrypto/lib/chacha20'); -const Poly1305 = require('bcrypto/lib/poly1305'); -const hash256 = require('bcrypto/lib/hash256'); -const bench = require('./bench'); - -console.log('note: rate measured in kb/s'); - -const chacha = new ChaCha20(); -const poly = new Poly1305(); -const key = Buffer.alloc(32, 0x02); -const iv = Buffer.from('0102030405060708', 'hex'); -const chunk = Buffer.allocUnsafe(32); -const data = Buffer.allocUnsafe(32); - -for (let i = 0; i < 32; i++) - chunk[i] = i; - -for (let i = 0; i < 32; i++) - data[i] = i & 0xff; - -chacha.init(key, iv, 0); -poly.init(key); - -{ - const end = bench('encrypt'); - for (let i = 0; i < 1000000; i++) - chacha.encrypt(chunk); - end(1000000 * 32 / 1024); -} - -{ - const end = bench('update'); - for (let i = 0; i < 1000000; i++) - poly.update(data); - end(1000000 * 32 / 1024); -} - -{ - const end = bench('finish'); - for (let i = 0; i < 1000000; i++) { - poly.init(key); - poly.update(data); - poly.final(); - } - end(1000000 * 32 / 1024); -} - -// For reference: -{ - const end = bench('sha256'); - for (let i = 0; i < 1000000; i++) - hash256.digest(data); - end(1000000 * 32 / 1024); -} diff --git a/package-lock.json b/package-lock.json index bf9253f13d..187de74c77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,263 +5,321 @@ "requires": true, "dependencies": { "bcfg": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/bcfg/-/bcfg-0.1.5.tgz", - "integrity": "sha512-a3dJQnXbBAl9wrhcki+H21mTtMKUJfdTuOcnGhDGSUQqpiBD5+uYfEvBz3vDFvBsuRguxV6Jp8kZQGwrMLQHPQ==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/bcfg/-/bcfg-0.1.6.tgz", + "integrity": "sha512-BR2vwQZwu24aRm588XHOnPVjjQtbK8sF0RopRFgMuke63/REJMWnePTa2YHKDBefuBYiVdgkowuB1/e4K7Ue3g==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" + }, + "dependencies": { + "bsert": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/bsert/-/bsert-0.0.10.tgz", + "integrity": "sha512-NHNwlac+WPy4t2LoNh8pXk8uaIGH3NSaIUbTTRXGpE2WEbq0te/tDykYHkFK57YKLPjv/aGHmbqvnGeVWDz57Q==" + } } }, "bclient": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/bclient/-/bclient-0.1.6.tgz", - "integrity": "sha512-rn8vriv1krI0rr3oOK6Xh6eeHjUEewXq44EPvP6GAhzBJ3/k6UvCXPZDmSkn+UzOLaHqkZSirxBXoOHlnyF/Bg==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/bclient/-/bclient-0.1.7.tgz", + "integrity": "sha512-tD1b48VGrJ10Hkv1Slew88DLcIBAYbhjGIwO7fRPp0mTcc5jZjGhFjsrHwgPsChj9HYctA8yMw/ChGfheqZGDA==", "requires": { - "bcfg": "~0.1.5", - "bcurl": "~0.1.5", - "bsert": "~0.0.8" + "bcfg": "~0.1.6", + "bcurl": "~0.1.6", + "bsert": "~0.0.10" + }, + "dependencies": { + "bsert": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/bsert/-/bsert-0.0.10.tgz", + "integrity": "sha512-NHNwlac+WPy4t2LoNh8pXk8uaIGH3NSaIUbTTRXGpE2WEbq0te/tDykYHkFK57YKLPjv/aGHmbqvnGeVWDz57Q==" + } } }, "bcrypto": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/bcrypto/-/bcrypto-3.0.2.tgz", - "integrity": "sha512-JGPVqeO+uvlo+5QTEO78jL4/5UVvBcqc8UPd7ctLMQTb2FR85aocdDDKk0vtyLpXY2/orRrD51h3/Q0GwuyZAg==", + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/bcrypto/-/bcrypto-3.1.11.tgz", + "integrity": "sha512-XHsle+v0aYjCyHZSwd3Insnu8GUe4cuf3+f07Z/mO+GLq60YqUyEIvpaSv4LAAJ4uf8UNYMSSQ0LslsV0r4tug==", "requires": { - "bindings": "~1.3.1", - "bsert": "~0.0.8", - "bufio": "~1.0.4", - "nan": "~2.12.1" + "bsert": "~0.0.10", + "bufio": "~1.0.6", + "loady": "~0.0.1", + "nan": "^2.13.2" } }, "bcurl": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/bcurl/-/bcurl-0.1.5.tgz", - "integrity": "sha512-X4B/fQoIAvSLn+tudTERyC+jSIGRztZ+DO9hS94Phy1OYsQqd2kWsxxX4AW1N09jJiCPzl0aCoLFoIrZP4Ofwg==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/bcurl/-/bcurl-0.1.6.tgz", + "integrity": "sha512-noeDhfqFiUcNOUuZKErkXcbZfxBjn6duTfYPEfA4hAYXGr7gwVxkAWvIerxl3ZLLyn8jzh7Oi0nHlrLm1ST9Fw==", "requires": { - "brq": "~0.1.6", - "bsert": "~0.0.8", - "bsock": "~0.1.5" + "brq": "~0.1.7", + "bsert": "~0.0.10", + "bsock": "~0.1.8" + }, + "dependencies": { + "brq": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/brq/-/brq-0.1.8.tgz", + "integrity": "sha512-6SDY1lJMKXgt5TZ6voJQMH2zV1XPWWtm203PSkx3DSg9AYNYuRfOPFSBDkNemabzgpzFW9/neR4YhTvyJml8rQ==", + "requires": { + "bsert": "~0.0.10" + } + }, + "bsert": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/bsert/-/bsert-0.0.10.tgz", + "integrity": "sha512-NHNwlac+WPy4t2LoNh8pXk8uaIGH3NSaIUbTTRXGpE2WEbq0te/tDykYHkFK57YKLPjv/aGHmbqvnGeVWDz57Q==" + }, + "bsock": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/bsock/-/bsock-0.1.9.tgz", + "integrity": "sha512-/l9Kg/c5o+n/0AqreMxh2jpzDMl1ikl4gUxT7RFNe3A3YRIyZkiREhwcjmqxiymJSRI/Qhew357xGn1SLw/xEw==", + "requires": { + "bsert": "~0.0.10" + } + } } }, "bdb": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bdb/-/bdb-1.1.5.tgz", - "integrity": "sha512-qzLKUVH2Ywy+uOU0idsebbq06a0IH21IrOrS5JVoeI9JjGeSBVjerPcg0pSoMQpLtg8whG7u85aGSs0OCRGhVA==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/bdb/-/bdb-1.1.7.tgz", + "integrity": "sha512-jtBnWEyDDK08dBbKL9LJeO2huZyBmbjBQMMVjU9RI1liJo6YDbv86uDHoaD4gniefd9pfxqOM1w6rYuwLVCXlQ==", "requires": { - "bindings": "~1.3.1", - "bsert": "~0.0.8" + "bsert": "~0.0.10", + "loady": "~0.0.1" + }, + "dependencies": { + "bsert": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/bsert/-/bsert-0.0.10.tgz", + "integrity": "sha512-NHNwlac+WPy4t2LoNh8pXk8uaIGH3NSaIUbTTRXGpE2WEbq0te/tDykYHkFK57YKLPjv/aGHmbqvnGeVWDz57Q==" + } } }, "bdns": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/bdns/-/bdns-0.1.4.tgz", - "integrity": "sha512-yem3lJ0qDMFCg95upnE6zvjKqifi6C3nB8Evo0xe5zw6hfYVd87Jy/SZh5qNL9wwSE0QDoX+Pa2Dv6C7+01gTQ==", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/bdns/-/bdns-0.1.5.tgz", + "integrity": "sha512-LNVkfM7ynlAD0CvPvO9cKxW8YXt1KOCRQZlRsGZWeMyymUWVdHQpZudAzH9chaFAz6HiwAnQxwDemCKDPy6Mag==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" + }, + "dependencies": { + "bsert": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/bsert/-/bsert-0.0.10.tgz", + "integrity": "sha512-NHNwlac+WPy4t2LoNh8pXk8uaIGH3NSaIUbTTRXGpE2WEbq0te/tDykYHkFK57YKLPjv/aGHmbqvnGeVWDz57Q==" + } } }, "bevent": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/bevent/-/bevent-0.1.4.tgz", - "integrity": "sha512-KXzbcGe2/jtP+/nAC/QkybrcP6iBtWiIxm0kEOBOQXk2irXcNjRgZuu8NxpTU5LYdYsbhY4Omsij/xE+YLLUtA==", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/bevent/-/bevent-0.1.5.tgz", + "integrity": "sha512-hs6T3BjndibrAmPSoKTHmKa3tz/c6Qgjv9iZw+tAoxuP6izfTCkzfltBQrW7SuK5xnY22gv9jCEf51+mRH+Qvg==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" + }, + "dependencies": { + "bsert": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/bsert/-/bsert-0.0.10.tgz", + "integrity": "sha512-NHNwlac+WPy4t2LoNh8pXk8uaIGH3NSaIUbTTRXGpE2WEbq0te/tDykYHkFK57YKLPjv/aGHmbqvnGeVWDz57Q==" + } } }, "bfile": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/bfile/-/bfile-0.1.4.tgz", - "integrity": "sha512-pqeG3lJbWAlYlphNzMQA/VeUNGaq7Zopvzl8hbYXzIXLIFdPqC2h2hCbZHzRlLnnaUfipmuqwWYr3qbulbuu6Q==" + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/bfile/-/bfile-0.2.1.tgz", + "integrity": "sha512-du2QjKNkqZ1YJweWEQeq3CEqd+nQD/WOnmAMfs52ok5ujBBagWYLZC5ORDuqfV2fuF88of44PZdsnAVfxoH31g==" }, "bfilter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/bfilter/-/bfilter-1.0.4.tgz", - "integrity": "sha512-C2x1hJLlm36UBT3iBCw9FShoazFqlZQaXha7Dp0Madb0hfzrWNtf9YclHLnNfp7UlcOyAKpojne7M4FFwEcSeA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/bfilter/-/bfilter-1.0.5.tgz", + "integrity": "sha512-GupIidtCvLbKhXnA1sxvrwa+gh95qbjafy7P1U1x/2DHxNabXq4nGW0x3rmgzlJMYlVl+c8fMxoMRIwpKYlgcQ==", "requires": { - "bsert": "~0.0.8", - "bufio": "~1.0.4", - "mrmr": "~0.1.5" + "bsert": "~0.0.10", + "bufio": "~1.0.6", + "mrmr": "~0.1.6" } }, "bheep": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/bheep/-/bheep-0.1.4.tgz", - "integrity": "sha512-uJ/fJWCBVx6g9ZM83p74626f2LxypH2u7wTheUZ68MgV+I0H3suX3vz19uxP0gEK/0ZB6MRVUU3O6952+8/ceQ==", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/bheep/-/bheep-0.1.5.tgz", + "integrity": "sha512-0KR5Zi8hgJBKL35+aYzndCTtgSGakOMxrYw2uszd5UmXTIfx3+drPGoETlVbQ6arTdAzSoQYA1j35vbaWpQXBg==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" } }, - "bindings": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.1.tgz", - "integrity": "sha512-i47mqjF9UbjxJhxGf+pZ6kSxrnI3wBLlnGI2ArWJ4r0VrvDS7ZYXkprq/pLaBWYq4GM0r4zdHY+NNRqEMU7uew==" - }, "binet": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/binet/-/binet-0.3.4.tgz", - "integrity": "sha512-UozdsJ7bGouXPTwATIMv/s5sWOJn/KgoCtZot6S+RAFnEhe9fD2LT6qtfaQzE3HNe4QlZXNXVa84efazLA8fjA==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/binet/-/binet-0.3.5.tgz", + "integrity": "sha512-suogkqXrt63Z76ABvwJjI28w+LWrRE53nwItDPz1VwNjHEuh1+rxudGYtoewFmMhkJ9pW/VGGnjoxP+AGzHgLQ==", "requires": { - "bs32": "~0.1.4", - "bsert": "~0.0.8" + "bs32": "~0.1.5", + "bsert": "~0.0.10" } }, "blgr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/blgr/-/blgr-0.1.5.tgz", - "integrity": "sha512-CIbMTg52rHR1WqLbDLc+9coNAYyEuJx7ezUtoGM9uzFWK5XxOuNimSSFoiYSfcCAc09qfchtkfOv41oNGIoDlQ==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/blgr/-/blgr-0.1.7.tgz", + "integrity": "sha512-+jSaU2jnYqF+ec9e8nzjfjU7QhZIntkDNG8/AEwoxW7J3mmwvmUfAI5lm9BFYs1OzT+1UgIZTFHa2qWjTBURfw==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" } }, "blru": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/blru/-/blru-0.1.5.tgz", - "integrity": "sha512-UGe9Bhu6WUln9bGGBs10I6zvhvzot57xAY39UNtimFZWZjvmdLNcPesIkypeAqYadg5WYlCygZaw1xq93S3kSw==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/blru/-/blru-0.1.6.tgz", + "integrity": "sha512-34+xZ2u4ys/aUzWCU9m6Eee4nVuN1ywdxbi8b3Z2WULU6qvnfeHvCWEdGzlVfRbbhimG2xxJX6R77GD2cuVO6w==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" } }, "blst": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/blst/-/blst-0.1.4.tgz", - "integrity": "sha512-G4eDv/d89wCwPwueItv6za6zxj2mKdikgZErJp2908Cz8Pa3h8KoHzwFu1bYcaAHJdexDp1B/Yjzb/K5+Bfb+g==", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/blst/-/blst-0.1.5.tgz", + "integrity": "sha512-TPl04Cx3CHdPFAJ2x9Xx1Z1FOfpAzmNPfHkfo+pGAaNH4uLhS58ExvamVkZh3jadF+B7V5sMtqvrqdf9mHINYA==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" } }, "bmocha": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/bmocha/-/bmocha-1.0.0.tgz", - "integrity": "sha512-dzq5ULNy0S63KLiWYPX98kwxRb0q+NFJp+6w7WJkz0OBMZuRpjqe1XWWz0z4qcCzePF9H51yRghj3QYVqdWEcw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bmocha/-/bmocha-2.1.2.tgz", + "integrity": "sha512-EvcGGQCbRnF3/Uq+gNIrWdNY65eDok17i7AKEY/xTLGFk812GdqEQ/FW8X1X1lyH5IlLshjubDjyC4HRWeCt7g==", "dev": true }, "bmutex": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/bmutex/-/bmutex-0.1.5.tgz", - "integrity": "sha512-vBKk+msKCdEE3Zs3fKxVATgibdf6U2k1dR1XALvXA/DuTDRQu9ot2TEp4RoJGilLvSlZxAHNq0AeBesd7KIe+Q==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/bmutex/-/bmutex-0.1.6.tgz", + "integrity": "sha512-nXWOXtQHbfPaMl6jyEF/rmRMrcemj2qn+OCAI/uZYurjfx7Dg3baoXdPzHOL0U8Cfvn8CWxKcnM/rgxL7DR4zw==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" } }, "brq": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/brq/-/brq-0.1.6.tgz", - "integrity": "sha512-hMYRlyg6UTuWQq12bXVvwYWNIkv5WC6iDiT4a83EW3JHMCKaVe3/wwrmguhGtpLagh0ah5YxM3QtasHvcWX5GQ==", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/brq/-/brq-0.1.8.tgz", + "integrity": "sha512-6SDY1lJMKXgt5TZ6voJQMH2zV1XPWWtm203PSkx3DSg9AYNYuRfOPFSBDkNemabzgpzFW9/neR4YhTvyJml8rQ==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" } }, "bs32": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/bs32/-/bs32-0.1.4.tgz", - "integrity": "sha512-IJuuNp3h5XJSn9QSDavROiMc9t9VbjfI4fRgdPtElG56LkB0kIdRgF+eTJpOsGqSTfBnYx/mn9nmC40Y8y9a8w==", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/bs32/-/bs32-0.1.5.tgz", + "integrity": "sha512-YR9OXFjx8qmW/TpuJKc1RSdzRogpCYh1ygCSMi5Z3fG2QkP+Ra1IfcHsICqd/I/tmFAtc7ov8BpEyN8HJD7jlw==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" } }, "bsert": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/bsert/-/bsert-0.0.8.tgz", - "integrity": "sha512-MzSxGNGymvJ2wAJ0lrC2cT+Irq2q+EMz5ijt8qXIxt02VoO+ZFWPNrmzNHGq6F8RJnIzzRmKz8mv1/j2xU1TQg==" + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/bsert/-/bsert-0.0.10.tgz", + "integrity": "sha512-NHNwlac+WPy4t2LoNh8pXk8uaIGH3NSaIUbTTRXGpE2WEbq0te/tDykYHkFK57YKLPjv/aGHmbqvnGeVWDz57Q==" }, "bsip": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/bsip/-/bsip-0.1.5.tgz", - "integrity": "sha512-soMYWfVwVr6umjSLm0mONf6kFrb0/Ulx9a5DfI08hLwMnq8Ju5MUTH/4bhYef3239SbZT/84cdEYEPCEI9JR3A==", + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/bsip/-/bsip-0.1.9.tgz", + "integrity": "sha512-i7cVEfCthASPB3BYKS/pZN/D4kh4vToIlSAFcVBLNjzYl1UirT3E2PIGSfNnYR2qZ3UW1qnDavrWEHhLeSKt2A==", "requires": { - "bindings": "~1.3.1", - "bsert": "~0.0.8", - "nan": "~2.12.1" + "bsert": "~0.0.10", + "loady": "~0.0.1", + "nan": "^2.13.1" } }, "bsock": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/bsock/-/bsock-0.1.5.tgz", - "integrity": "sha512-Q41VI1jX3hVbv8NBz+/HCvJXEN2/WVeXUJzooLE69LmVdsdwbN77v0pd5Efvz5+JNASV8iESfxitvdx/uknfNQ==", + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/bsock/-/bsock-0.1.9.tgz", + "integrity": "sha512-/l9Kg/c5o+n/0AqreMxh2jpzDMl1ikl4gUxT7RFNe3A3YRIyZkiREhwcjmqxiymJSRI/Qhew357xGn1SLw/xEw==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" } }, "bsocks": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/bsocks/-/bsocks-0.2.4.tgz", - "integrity": "sha512-FSDsP1VeuUXbIU5FaJstfNCP8LECFz13olT5LvLko6SH9EVNnfajxShkfyiO3WkYJ9nL1GVQXDqVQSPF+Bgd7A==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/bsocks/-/bsocks-0.2.5.tgz", + "integrity": "sha512-w1yG8JmfKPIaTDLuR9TIxJM2Ma6nAiInRpLNZ43g3qPnPHjawCC4SV6Bdy84bEJQX1zJWYTgdod/BnQlDhq4Gg==", "requires": { - "binet": "~0.3.4", - "bsert": "~0.0.8" + "binet": "~0.3.5", + "bsert": "~0.0.10" } }, "bstring": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/bstring/-/bstring-0.3.5.tgz", - "integrity": "sha512-EgVL5WgawTtUCl/P8rZZicP+/p7X71OY9T9i1bTPNtR4587FPyxq+Dne0JuY37g/apj89RhHut7aJMS2l042Dg==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/bstring/-/bstring-0.3.9.tgz", + "integrity": "sha512-D95flI7SXL+UsQi9mW+hH+AK2AFfafIJi+3GbbyTAWMe2FqwR9keBxsjGiGd/JM+77Y9WsC+M4EhZVNVcym9jw==", "requires": { - "bindings": "~1.3.1", - "bsert": "~0.0.8", - "nan": "~2.12.1" + "bsert": "~0.0.10", + "loady": "~0.0.1", + "nan": "^2.13.1" } }, "btcp": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/btcp/-/btcp-0.1.4.tgz", - "integrity": "sha512-Byfk+kgg8bCqPWLoCltIES42xk25JWIoQMJ31bJ/yli/WflEGDtmnNEtZWoW3dzV6d8t+LfANkTXXavn1G9uAA==" + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/btcp/-/btcp-0.1.5.tgz", + "integrity": "sha512-tkrtMDxeJorn5p0KxaLXELneT8AbfZMpOFeoKYZ5qCCMMSluNuwut7pGccLC5YOJqmuk0DR774vNVQLC9sNq/A==" }, "buffer-map": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/buffer-map/-/buffer-map-0.0.5.tgz", - "integrity": "sha512-evwvw2VDQvYxKPdxmqIWTIIYZKypKWHoLolB1kmyY05RNGY7EWifLSE1fLmz6+2UkQBmZ1suXJAoHOzlLeO83A==" + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/buffer-map/-/buffer-map-0.0.7.tgz", + "integrity": "sha512-95try3p/vMRkIAAnJDaGkFhGpT/65NoeW6XelEPjAomWYR58RQtW4khn0SwKj34kZoE7uxL7w2koZSwbnszvQQ==" }, "bufio": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/bufio/-/bufio-1.0.4.tgz", - "integrity": "sha512-z5HOP06DHRlwB6C4Ol6RNA2HWam8Pluo5pasPniQVyC4dzwutzYHHHDjDSOgSyGeThE7kmgT7ynV1A+EuD8s3w==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/bufio/-/bufio-1.0.6.tgz", + "integrity": "sha512-mjYZFRHmI9bk3Oeexu0rWjHFY+w6hGLabdmwSFzq+EFr4MHHsNOYduDVdYl71NG5pTPL7GGzUCMk9cYuV34/Qw==" }, "bupnp": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/bupnp/-/bupnp-0.2.5.tgz", - "integrity": "sha512-NLedlDlgopiSGRewmgFqSqnHHlNcUDeHxW+pEwBNnbCDTa5qC5vAmtOd6AbceTs3kTluu+znu9x1snoaaroSbA==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bupnp/-/bupnp-0.2.6.tgz", + "integrity": "sha512-J6ykzJhZMxXKN78K+1NzFi3v/51X2Mvzp2hW42BWwmxIVfau6PaN99gyABZ8x05e8MObWbsAis23gShhj9qpbw==", "requires": { - "binet": "~0.3.4", - "brq": "~0.1.6", - "bsert": "~0.0.8" + "binet": "~0.3.5", + "brq": "~0.1.7", + "bsert": "~0.0.10" } }, "bval": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/bval/-/bval-0.1.5.tgz", - "integrity": "sha512-PN7Ps7MHrFk7H1cT/mvRsa8J3bx1MrApxDXZx3kee4hCjDns2v89rWO8wnuEcLEVZvNqayjKm6ATia9FRtd2aw==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/bval/-/bval-0.1.6.tgz", + "integrity": "sha512-jxNH9gSx7g749hQtS+nTxXYz/bLxwr4We1RHFkCYalNYcj12RfbW6qYWsKu0RYiKAdFcbNoZRHmWrIuXIyhiQQ==", "requires": { - "bsert": "~0.0.8" + "bsert": "~0.0.10" } }, "bweb": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/bweb/-/bweb-0.1.7.tgz", - "integrity": "sha512-mvjXvyvbe3TPQ5AW0K4kgfAMgkyCj3/JhTzl5+pJsOv+SvdXNeJsafruVubfj28PTXfVD08SH9EEuKrtsUYCHA==", + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/bweb/-/bweb-0.1.9.tgz", + "integrity": "sha512-Ozz6Vq7mC0ydHxnykvkUIiwduKAW4Qewj+au0osTCSssfXfRYrO7O2UluLgZQL0sSrXiifqEdJaGtOQ+GAeC8A==", "requires": { - "bsert": "~0.0.8", - "bsock": "~0.1.5" + "bsert": "~0.0.10", + "bsock": "~0.1.8" } }, + "loady": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/loady/-/loady-0.0.1.tgz", + "integrity": "sha512-PW5Z13Jd0v6ZcA1P6ZVUc3EV8BJwQuAiwUvvT6VQGHoaZ1d/tu7r1QZctuKfQqwy9SFBWeAGfcIdLxhp7ZW3Rw==" + }, "mrmr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/mrmr/-/mrmr-0.1.5.tgz", - "integrity": "sha512-DgnUGXVpyF2t93u6g4b63o547/LIG4qCq4LNTTKsAPyVdjar4l5TgzNoEp+/T//TafYk+oL/O9XwgVbOxUK9uw==", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/mrmr/-/mrmr-0.1.8.tgz", + "integrity": "sha512-lNav10EJsPZvlMqlBOYQ5atIO9jrlvbJ4/7asqunXY89dHooN5c+W6AV7jtvBRw4wFDR7TpEWfmBQgRGRVwBzA==", "requires": { - "bindings": "~1.3.1", - "bsert": "~0.0.8", - "nan": "~2.12.1" + "bsert": "~0.0.10", + "loady": "~0.0.1", + "nan": "^2.13.1" } }, "n64": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/n64/-/n64-0.2.6.tgz", - "integrity": "sha512-UMoVVrk28Lkk3rjroRp8QU0ElaihWyMZ1NZj3NootEQmbSKKQoeIp6B4aMguWZIsFnOCW5sfVt0vx7gFsOWZQQ==" + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/n64/-/n64-0.2.10.tgz", + "integrity": "sha512-uH9geV4+roR1tohsrrqSOLCJ9Mh1iFcDI+9vUuydDlDxUS1UCAWUfuGb06p3dj3flzywquJNrGsQ7lHP8+4RVQ==" }, "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" } } } diff --git a/package.json b/package.json index faf5d8aeb6..b8619dce83 100644 --- a/package.json +++ b/package.json @@ -20,39 +20,39 @@ "wallet" ], "engines": { - "node": ">=8.0.0" + "node": ">=8.6.0" }, "dependencies": { - "bcfg": "~0.1.5", - "bclient": "~0.1.6", - "bcrypto": "~3.0.2", - "bdb": "~1.1.5", - "bdns": "~0.1.4", - "bevent": "~0.1.4", - "bfile": "~0.1.4", - "bfilter": "~1.0.4", - "bheep": "~0.1.4", - "binet": "~0.3.4", - "blgr": "~0.1.5", - "blru": "~0.1.5", - "blst": "~0.1.4", - "bmutex": "~0.1.5", - "bsert": "~0.0.8", - "bsip": "~0.1.5", - "bsock": "~0.1.5", - "bsocks": "~0.2.4", - "bstring": "~0.3.5", - "btcp": "~0.1.4", - "buffer-map": "~0.0.5", - "bufio": "~1.0.4", - "bupnp": "~0.2.5", - "bval": "~0.1.5", - "bweb": "~0.1.7", - "mrmr": "~0.1.5", - "n64": "~0.2.6" + "bcfg": "~0.1.6", + "bclient": "~0.1.7", + "bcrypto": "~3.1.11", + "bdb": "~1.1.7", + "bdns": "~0.1.5", + "bevent": "~0.1.5", + "bfile": "~0.2.1", + "bfilter": "~1.0.5", + "bheep": "~0.1.5", + "binet": "~0.3.5", + "blgr": "~0.1.7", + "blru": "~0.1.6", + "blst": "~0.1.5", + "bmutex": "~0.1.6", + "bsert": "~0.0.10", + "bsip": "~0.1.9", + "bsock": "~0.1.9", + "bsocks": "~0.2.5", + "bstring": "~0.3.9", + "btcp": "~0.1.5", + "buffer-map": "~0.0.7", + "bufio": "~1.0.6", + "bupnp": "~0.2.6", + "bval": "~0.1.6", + "bweb": "~0.1.9", + "mrmr": "~0.1.8", + "n64": "~0.2.10" }, "devDependencies": { - "bmocha": "^1.0.0" + "bmocha": "^2.1.2" }, "main": "./lib/bcoin.js", "bin": { @@ -74,7 +74,7 @@ "test-browser": "NODE_BACKEND=js bmocha --reporter spec test/*.js", "test-file": "bmocha --reporter spec", "test-file-browser": "NODE_BACKEND=js bmocha --reporter spec", - "test-ci": "istanbul cover --report lcovonly node_modules/.bin/bmocha -- --reporter spec test/*-test.js" + "test-ci": "istanbul cover --report lcovonly node_modules/.bin/bmocha --reporter spec test/*-test.js" }, "browser": { "./lib/hd/nfkd": "./lib/hd/nfkd-compat.js", diff --git a/test/http-test.js b/test/http-test.js index 6c52fffe96..033b5afb93 100644 --- a/test/http-test.js +++ b/test/http-test.js @@ -40,7 +40,8 @@ const {NodeClient, WalletClient} = require('bclient'); const nclient = new NodeClient({ port: ports.node, - apiKey: 'foo' + apiKey: 'foo', + timeout: 15000 }); const wclient = new WalletClient({ diff --git a/test/mempool-test.js b/test/mempool-test.js index dbe19b3779..c0969f60bd 100644 --- a/test/mempool-test.js +++ b/test/mempool-test.js @@ -111,6 +111,7 @@ describe('Mempool', function() { }); it('should handle incoming orphans and TXs', async () => { + this.timeout(20000); const key = KeyRing.generate(); const t1 = new MTX(); @@ -887,6 +888,7 @@ describe('Mempool', function() { }); it('should restore txs in the mempool', async () => { + this.timeout(20000); const coins = chaincoins.getCoins(); assert.strictEqual(coins.length, N); diff --git a/test/rpc-test.js b/test/rpc-test.js index da4e43a9c7..9357f410f5 100644 --- a/test/rpc-test.js +++ b/test/rpc-test.js @@ -31,7 +31,8 @@ const {NodeClient, WalletClient} = require('bclient'); const nclient = new NodeClient({ port: ports.node, - apiKey: 'foo' + apiKey: 'foo', + timeout: 15000 }); const wclient = new WalletClient({