From 4172bc61612250a973fc3d3d5e1f748bcefb61e1 Mon Sep 17 00:00:00 2001 From: homura Date: Thu, 20 Jan 2022 15:48:22 +0800 Subject: [PATCH 1/2] fix: toolkit test coverage --- packages/toolkit/package.json | 24 +- packages/toolkit/rollup.config.js | 57 --- packages/toolkit/tests/serializers.js | 2 +- packages/toolkit/tests/transformers.js | 2 +- packages/toolkit/tests/validators.js | 2 +- yarn.lock | 588 ++----------------------- 6 files changed, 44 insertions(+), 631 deletions(-) delete mode 100644 packages/toolkit/rollup.config.js diff --git a/packages/toolkit/package.json b/packages/toolkit/package.json index 2f5f3dc09..c95059073 100644 --- a/packages/toolkit/package.json +++ b/packages/toolkit/package.json @@ -2,8 +2,7 @@ "name": "@ckb-lumos/toolkit", "version": "0.17.0-rc7", "description": "JavaScript toolkits used to build dapps for Nervos CKB", - "main": "lib/ckb-js-toolkit.node.js", - "browser": "lib/ckb-js-toolkit.esm.js", + "main": "lib/index.js", "types": "index.d.ts", "engines": { "node": ">=12.0.0" @@ -22,25 +21,18 @@ "lib" ], "scripts": { - "build": "rollup -c --environment BUILD:production", - "test": "rollup -c --environment BUILD:development && ava", + "build": "yarn run build:js", + "build:js": "babel -s --plugins @babel/plugin-proposal-export-namespace-from --plugins @babel/plugin-transform-modules-commonjs src --out-dir lib", + "clean": "rm -rf lib", + "test": "ava", "fmt": "prettier --write \"{src,tests}/**/*.js\" index.d.ts", "lint": "eslint -c ../../.eslintrc.js \"{src,tests}/**/*.js\"", "update-test-files": "curl -L https://raw.githubusercontent.com/nervosnetwork/ckb/27c36a55e6358fd04153ec3da4638b6e10660da6/util/types/schemas/blockchain.mol -o testfiles/blockchain.mol && moleculec --language - --schema-file testfiles/blockchain.mol --format json > testfiles/blockchain.json && moleculec-es -inputFile testfiles/blockchain.json -outputFile testfiles/blockchain.esm.js && rollup -f umd -i testfiles/blockchain.esm.js -o testfiles/blockchain.umd.js --name Blockchain && rm testfiles/blockchain.mol testfiles/blockchain.json testfiles/blockchain.esm.js" }, "author": "Xuejie Xiao", "license": "MIT", - "dependencies": { - "cross-fetch": "^3.0.6", - "jsbi": "^3.1.2" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^15.0.0", - "@rollup/plugin-node-resolve": "^9.0.0", - "@rollup/plugin-replace": "^2.3.3", - "ava": "^3.5.0", - "prettier": "1.19.1", - "rollup": "^2.22.0", - "rollup-plugin-terser": "^7.0.2" + "peerDependencies": { + "cross-fetch": "^3.1.4", + "jsbi": "^4.1.0" } } diff --git a/packages/toolkit/rollup.config.js b/packages/toolkit/rollup.config.js deleted file mode 100644 index 5d53327ed..000000000 --- a/packages/toolkit/rollup.config.js +++ /dev/null @@ -1,57 +0,0 @@ -import resolve from "@rollup/plugin-node-resolve"; -import commonjs from "@rollup/plugin-commonjs"; -import replace from "@rollup/plugin-replace"; -import { terser } from "rollup-plugin-terser"; - -import * as package_json from "./package.json"; - -const isProduction = process.env.BUILD === 'production'; -const outputFolder = "lib"; -const sourcemap = !isProduction; - -module.exports = [ - { - input: "src/index.js", - output: { - file: outputFolder + "/ckb-js-toolkit.node.js", - format: "cjs", - sourcemap: true - }, - plugins: [ - replace({__development_build__: package_json.version}), - resolve({preferBuiltins: true}), - commonjs(), - isProduction && terser() - ] - }, - // TODO: do we need sourcemap for UMD and ESM versions? - { - input: "src/index.js", - output: { - file: outputFolder + "/ckb-js-toolkit.umd.js", - format: "umd", - name: "CKBJSToolkit", - sourcemap: sourcemap - }, - plugins: [ - replace({__development_build__: package_json.version}), - resolve({browser: true, preferBuiltins: false}), - commonjs(), - isProduction && terser() - ] - }, - { - input: "src/index.js", - output: { - file: outputFolder + "/ckb-js-toolkit.esm.js", - format: "esm", - sourcemap: sourcemap - }, - plugins: [ - replace({__development_build__: package_json.version}), - resolve({browser: true, preferBuiltins: false}), - commonjs(), - isProduction && terser() - ] - } -]; diff --git a/packages/toolkit/tests/serializers.js b/packages/toolkit/tests/serializers.js index 1d20b860a..fdf79af8c 100644 --- a/packages/toolkit/tests/serializers.js +++ b/packages/toolkit/tests/serializers.js @@ -1,5 +1,5 @@ const test = require("ava"); -const { normalizers, Reader } = require("../lib/ckb-js-toolkit.node.js"); +const { normalizers, Reader } = require("../lib"); const CKB = require("../testfiles/blockchain.umd.js"); test("normalize and serialize script", t => { diff --git a/packages/toolkit/tests/transformers.js b/packages/toolkit/tests/transformers.js index c3cc8b433..d6d6b3917 100644 --- a/packages/toolkit/tests/transformers.js +++ b/packages/toolkit/tests/transformers.js @@ -1,5 +1,5 @@ const test = require("ava"); -const { transformers, Reader } = require("../lib/ckb-js-toolkit.node.js"); +const { transformers, Reader } = require("../lib"); test("transform script", t => { const s = transformers.TransformScript({ diff --git a/packages/toolkit/tests/validators.js b/packages/toolkit/tests/validators.js index caf4da429..424a39f8d 100644 --- a/packages/toolkit/tests/validators.js +++ b/packages/toolkit/tests/validators.js @@ -1,5 +1,5 @@ const test = require("ava"); -const { validators } = require("../lib/ckb-js-toolkit.node.js"); +const { validators } = require("../lib"); test("correct script should pass validation", t => { validators.ValidateScript({ diff --git a/yarn.lock b/yarn.lock index 292bfe8bb..9b06ccdd7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -48,13 +48,6 @@ dependencies: "@babel/highlight" "^7.10.1" -"@babel/code-frame@^7.10.4", "@babel/code-frame@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== - dependencies: - "@babel/highlight" "^7.16.7" - "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.8.3": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" @@ -62,6 +55,13 @@ dependencies: "@babel/highlight" "^7.16.0" +"@babel/code-frame@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== + dependencies: + "@babel/highlight" "^7.16.7" + "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.0", "@babel/compat-data@^7.16.4": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" @@ -2101,48 +2101,6 @@ dependencies: "@octokit/openapi-types" "^11.2.0" -"@rollup/plugin-commonjs@^15.0.0": - version "15.1.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-15.1.0.tgz#1e7d076c4f1b2abf7e65248570e555defc37c238" - integrity sha512-xCQqz4z/o0h2syQ7d9LskIMvBSH4PX5PjYdpSSvgS+pQik3WahkQVNWg3D8XJeYjZoVWnIUQYDghuEMRGrmQYQ== - dependencies: - "@rollup/pluginutils" "^3.1.0" - commondir "^1.0.1" - estree-walker "^2.0.1" - glob "^7.1.6" - is-reference "^1.2.1" - magic-string "^0.25.7" - resolve "^1.17.0" - -"@rollup/plugin-node-resolve@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz#39bd0034ce9126b39c1699695f440b4b7d2b62e6" - integrity sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" - builtin-modules "^3.1.0" - deepmerge "^4.2.2" - is-module "^1.0.0" - resolve "^1.17.0" - -"@rollup/plugin-replace@^2.3.3": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" - integrity sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - magic-string "^0.25.7" - -"@rollup/pluginutils@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" - integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== - dependencies: - "@types/estree" "0.0.39" - estree-walker "^1.0.1" - picomatch "^2.2.2" - "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -2318,11 +2276,6 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.44.tgz#980cc5a29a3ef3bea6ff1f7d021047d7ea575e21" integrity sha512-iaIVzr+w2ZJ5HkidlZ3EJM8VTZb2MJLCjw3V+505yVts0gRC4UMvjw0d1HPtGqI/HQC/KdsYtayfzl+AXY2R8g== -"@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== - "@types/estree@^0.0.50": version "0.0.50" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" @@ -2443,13 +2396,6 @@ "@types/scheduler" "*" csstype "^3.0.2" -"@types/resolve@1.17.1": - version "1.17.1" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" - integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== - dependencies: - "@types/node" "*" - "@types/scheduler@*": version "0.16.2" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" @@ -2719,7 +2665,7 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.1.1.tgz#345f0dffad5c735e7373d2fec9a1023e6a44b83e" integrity sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ== -acorn-walk@^8.0.0, acorn-walk@^8.1.1: +acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -2729,11 +2675,6 @@ acorn@^7.1.0, acorn@^7.1.1, acorn@^7.2.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.2.0.tgz#17ea7e40d7c8640ff54a694c889c26f31704effe" integrity sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ== -acorn@^8.0.4: - version "8.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" - integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== - acorn@^8.4.1: version "8.5.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" @@ -2839,11 +2780,6 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0, ansi-styles@^4.2.1: "@types/color-name" "^1.1.1" color-convert "^2.0.1" -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - ansicolors@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979" @@ -3041,68 +2977,6 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -ava@^3.5.0: - version "3.15.0" - resolved "https://registry.yarnpkg.com/ava/-/ava-3.15.0.tgz#a239658ab1de8a29a243cc902e6b42e4574de2f0" - integrity sha512-HGAnk1SHPk4Sx6plFAUkzV/XC1j9+iQhOzt4vBly18/yo0AV8Oytx7mtJd/CR8igCJ5p160N/Oo/cNJi2uSeWA== - dependencies: - "@concordance/react" "^2.0.0" - acorn "^8.0.4" - acorn-walk "^8.0.0" - ansi-styles "^5.0.0" - arrgv "^1.0.2" - arrify "^2.0.1" - callsites "^3.1.0" - chalk "^4.1.0" - chokidar "^3.4.3" - chunkd "^2.0.1" - ci-info "^2.0.0" - ci-parallel-vars "^1.0.1" - clean-yaml-object "^0.1.0" - cli-cursor "^3.1.0" - cli-truncate "^2.1.0" - code-excerpt "^3.0.0" - common-path-prefix "^3.0.0" - concordance "^5.0.1" - convert-source-map "^1.7.0" - currently-unhandled "^0.4.1" - debug "^4.3.1" - del "^6.0.0" - emittery "^0.8.0" - equal-length "^1.0.0" - figures "^3.2.0" - globby "^11.0.1" - ignore-by-default "^2.0.0" - import-local "^3.0.2" - indent-string "^4.0.0" - is-error "^2.2.2" - is-plain-object "^5.0.0" - is-promise "^4.0.0" - lodash "^4.17.20" - matcher "^3.0.0" - md5-hex "^3.0.1" - mem "^8.0.0" - ms "^2.1.3" - ora "^5.2.0" - p-event "^4.2.0" - p-map "^4.0.0" - picomatch "^2.2.2" - pkg-conf "^3.1.0" - plur "^4.0.0" - pretty-ms "^7.0.1" - read-pkg "^5.2.0" - resolve-cwd "^3.0.0" - slash "^3.0.0" - source-map-support "^0.5.19" - stack-utils "^2.0.3" - strip-ansi "^6.0.0" - supertap "^2.0.0" - temp-dir "^2.0.0" - trim-off-newlines "^1.0.1" - update-notifier "^5.0.1" - write-file-atomic "^3.0.3" - yargs "^16.2.0" - ava@^3.8.2: version "3.8.2" resolved "https://registry.yarnpkg.com/ava/-/ava-3.8.2.tgz#877c9eb861763a185bbabd54f359e1fbe57d1754" @@ -3255,15 +3129,6 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" integrity sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow== -bl@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - blake2b-wasm@^1.1.0: version "1.1.7" resolved "https://registry.yarnpkg.com/blake2b-wasm/-/blake2b-wasm-1.1.7.tgz#e4d075da10068e5d4c3ec1fb9accc4d186c55d81" @@ -3329,20 +3194,6 @@ boxen@^4.2.0: type-fest "^0.8.1" widest-line "^3.1.0" -boxen@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" - integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== - dependencies: - ansi-align "^3.0.0" - camelcase "^6.2.0" - chalk "^4.1.0" - cli-boxes "^2.2.1" - string-width "^4.2.2" - type-fest "^0.20.2" - widest-line "^3.1.0" - wrap-ansi "^7.0.0" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -3473,14 +3324,6 @@ buffer@5.6.0: base64-js "^1.0.2" ieee754 "^1.1.4" -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - buffer@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -3489,11 +3332,6 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -builtin-modules@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" - integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== - builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" @@ -3611,11 +3449,6 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -camelcase@^6.2.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - caniuse-lite@^1.0.30001280: version "1.0.30001282" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001282.tgz#38c781ee0a90ccfe1fe7fefd00e43f5ffdcb96fd" @@ -3706,7 +3539,7 @@ chokidar@^3.4.0: optionalDependencies: fsevents "~2.1.2" -chokidar@^3.4.2, chokidar@^3.4.3: +chokidar@^3.4.2: version "3.5.2" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== @@ -3751,11 +3584,6 @@ ci-parallel-vars@^1.0.0: resolved "https://registry.yarnpkg.com/ci-parallel-vars/-/ci-parallel-vars-1.0.0.tgz#af97729ed1c7381911ca37bcea263d62638701b3" integrity sha512-u6dx20FBXm+apMi+5x7UVm6EH7BL1gc4XrcnQewjcB7HWRcor/V5qWc3RG2HwpgDJ26gIi2DSEu3B7sXynAw/g== -ci-parallel-vars@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ci-parallel-vars/-/ci-parallel-vars-1.0.1.tgz#e87ff0625ccf9d286985b29b4ada8485ca9ffbc2" - integrity sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg== - cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -3789,11 +3617,6 @@ cli-boxes@^2.2.0: resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.0.tgz#538ecae8f9c6ca508e3c3c95b453fe93cb4c168d" integrity sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w== -cli-boxes@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" - integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== - cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -3813,11 +3636,6 @@ cli-spinners@^2.2.0: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.3.0.tgz#0632239a4b5aa4c958610142c34bb7a651fc8df5" integrity sha512-Xs2Hf2nzrvJMFKimOR7YR0QwZ8fc0u98kdtwN1eNAZzNQgH3vK2pXzff6GJtKh7S5hoJ87ECiAiZFS2fb5Ii2w== -cli-spinners@^2.5.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" - integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== - cli-truncate@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" @@ -3889,13 +3707,6 @@ code-excerpt@^2.1.1: dependencies: convert-to-spaces "^1.0.1" -code-excerpt@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/code-excerpt/-/code-excerpt-3.0.0.tgz#fcfb6748c03dba8431c19f5474747fad3f250f10" - integrity sha512-VHNTVhd7KsLGOqfX3SyeO8RyYPMp1GJOg194VITk04WMYCv4plV68YWe6TJZxd9MhobjtpMRnVky01gqZsalaw== - dependencies: - convert-to-spaces "^1.0.1" - code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" @@ -4009,11 +3820,6 @@ common-path-prefix@^3.0.0: resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0" integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w== -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= - compare-func@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" @@ -4059,20 +3865,6 @@ concordance@^4.0.0: semver "^5.5.1" well-known-symbols "^2.0.0" -concordance@^5.0.1: - version "5.0.4" - resolved "https://registry.yarnpkg.com/concordance/-/concordance-5.0.4.tgz#9896073261adced72f88d60e4d56f8efc4bbbbd2" - integrity sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw== - dependencies: - date-time "^3.1.0" - esutils "^2.0.3" - fast-diff "^1.2.0" - js-string-escape "^1.0.1" - lodash "^4.17.15" - md5-hex "^3.0.1" - semver "^7.3.2" - well-known-symbols "^2.0.0" - config-chain@^1.1.12: version "1.1.13" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4" @@ -4297,13 +4089,6 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-fetch@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" - integrity sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ== - dependencies: - node-fetch "2.6.1" - cross-fetch@^3.1.4: version "3.1.4" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" @@ -4384,13 +4169,6 @@ date-time@^2.1.0: dependencies: time-zone "^1.0.0" -date-time@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/date-time/-/date-time-3.1.0.tgz#0d1e934d170579f481ed8df1e2b8ff70ee845e1e" - integrity sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg== - dependencies: - time-zone "^1.0.0" - dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -4541,20 +4319,6 @@ del@^5.1.0: rimraf "^3.0.0" slash "^3.0.0" -del@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/del/-/del-6.0.0.tgz#0b40d0332cea743f1614f818be4feb717714c952" - integrity sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ== - dependencies: - globby "^11.0.1" - graceful-fs "^4.2.4" - is-glob "^4.0.1" - is-path-cwd "^2.2.0" - is-path-inside "^3.0.2" - p-map "^4.0.0" - rimraf "^3.0.2" - slash "^3.0.0" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -4734,11 +4498,6 @@ emittery@^0.6.0: resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.6.0.tgz#e85312468d77c3ed9a6adf43bb57d34849e0c95a" integrity sha512-6EMRGr9KzYWp8DzHFZsKVZBsMO6QhAeHMeHND8rhyBNCHKMLpgW9tZv40bwN3rAIKRS5CxcK8oLRKUJSB9h7yQ== -emittery@^0.8.0: - version "0.8.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" - integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== - emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -4998,17 +4757,7 @@ estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -estree-walker@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" - integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== - -estree-walker@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - -esutils@^2.0.2, esutils@^2.0.3: +esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== @@ -5174,7 +4923,7 @@ fast-deep-equal@^3.1.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== -fast-diff@^1.1.2, fast-diff@^1.2.0: +fast-diff@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== @@ -5191,17 +4940,6 @@ fast-glob@^3.0.3, fast-glob@^3.1.1: micromatch "^4.0.2" picomatch "^2.2.1" -fast-glob@^3.2.9: - version "3.2.10" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.10.tgz#2734f83baa7f43b7fd41e13bc34438f4ffe284ee" - integrity sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -5651,7 +5389,7 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: +glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@~5.1.0, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -5682,13 +5420,6 @@ global-dirs@^2.0.1: dependencies: ini "^1.3.5" -global-dirs@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.0.tgz#70a76fe84ea315ab37b1f5576cbde7d48ef72686" - integrity sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA== - dependencies: - ini "2.0.0" - global-modules@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" @@ -5747,18 +5478,6 @@ globby@^11.0.0: merge2 "^1.3.0" slash "^3.0.0" -globby@^11.0.1: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - globby@^11.0.2: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" @@ -6054,26 +5773,21 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -ieee754@^1.1.13, ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - ieee754@^1.1.4: version "1.1.13" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ignore-by-default@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk= -ignore-by-default@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-2.0.0.tgz#537092018540640459569fe7c8c7a408af581146" - integrity sha512-+mQSgMRiFD3L3AOxLYOCxjIq4OnAmo5CIuC+lj5ehCJcPtV++QacEV7FdpzvYxH6DaOySWzQU6RR0lPLy37ckA== - ignore-walk@^3.0.1: version "3.0.3" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37" @@ -6098,11 +5812,6 @@ ignore@^5.1.1, ignore@^5.1.4: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== -ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== - immutable@^4.0.0-rc.12: version "4.0.0-rc.12" resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0-rc.12.tgz#ca59a7e4c19ae8d9bf74a97bdf0f6e2f2a5d0217" @@ -6175,11 +5884,6 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -ini@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" - integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== - ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" @@ -6468,14 +6172,6 @@ is-installed-globally@^0.3.1: global-dirs "^2.0.1" is-path-inside "^3.0.1" -is-installed-globally@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" - integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== - dependencies: - global-dirs "^3.0.0" - is-path-inside "^3.0.2" - is-interactive@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" @@ -6486,11 +6182,6 @@ is-lambda@^1.0.1: resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= -is-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" - integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= - is-negative-zero@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" @@ -6501,11 +6192,6 @@ is-npm@^4.0.0: resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== -is-npm@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8" - integrity sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA== - is-number-object@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" @@ -6540,11 +6226,6 @@ is-path-inside@^3.0.1: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== -is-path-inside@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -6584,13 +6265,6 @@ is-property@^1.0.2: resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" integrity sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ= -is-reference@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" - integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== - dependencies: - "@types/estree" "*" - is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -6656,11 +6330,6 @@ is-unc-path@^1.0.0: dependencies: unc-path-regex "^0.1.2" -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - is-weakref@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" @@ -6737,15 +6406,6 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-worker@^26.2.1: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^7.0.0" - jest-worker@^27.0.6: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.1.tgz#0def7feae5b8042be38479799aeb7b5facac24b2" @@ -6778,19 +6438,6 @@ js-yaml@^3.10.0, js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.14.0: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbi@^3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.1.3.tgz#f024b340032f7c7caaa6ca4b32b55e8d33f6e897" - integrity sha512-nBJqA0C6Qns+ZxurbEoIR56wyjiUszpNy70FHvxO5ervMoCbZVE3z3kxr5nKGhlxr/9MhKTSUBs7cAwwuf3g9w== - jsbi@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-4.1.0.tgz#f0c25ed8881bc09891334b03a3952efaa7add337" @@ -6954,7 +6601,7 @@ knex@^0.21.1: uuid "^7.0.3" v8flags "^3.1.3" -latest-version@^5.0.0, latest-version@^5.1.0: +latest-version@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== @@ -7159,7 +6806,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.3.0, lodash@^4.7.0: +lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.3.0, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -7171,14 +6818,6 @@ log-symbols@^3.0.0: dependencies: chalk "^2.4.2" -log-symbols@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - long@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" @@ -7228,13 +6867,6 @@ lunr@^2.3.8: resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.8.tgz#a8b89c31f30b5a044b97d2d28e2da191b6ba2072" integrity sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg== -magic-string@^0.25.7: - version "0.25.7" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== - dependencies: - sourcemap-codec "^1.4.4" - make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -7387,14 +7019,6 @@ mem@^6.1.0: map-age-cleaner "^0.1.3" mimic-fn "^3.0.0" -mem@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/mem/-/mem-8.1.1.tgz#cf118b357c65ab7b7e0817bdf00c8062297c0122" - integrity sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA== - dependencies: - map-age-cleaner "^0.1.3" - mimic-fn "^3.1.0" - memfs@^3.1.2: version "3.3.0" resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.3.0.tgz#4da2d1fc40a04b170a56622c7164c6be2c4cbef2" @@ -7434,7 +7058,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: +merge2@^1.2.3, merge2@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -7463,7 +7087,7 @@ micromatch@^3.0.4: snapdragon "^0.8.1" to-regex "^3.0.2" -micromatch@^4.0.0, micromatch@^4.0.4: +micromatch@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -7543,11 +7167,6 @@ mimic-fn@^3.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-3.0.0.tgz#76044cfa8818bbf6999c5c9acadf2d3649b14b4b" integrity sha512-PiVO95TKvhiwgSwg1IdLYlCTdul38yZxZMIcnDSFIBUm4BNZha2qpQ4GpJ++15bHoKDtrW2D69lMfFwdFYtNZQ== -mimic-fn@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-3.1.0.tgz#65755145bbf3e36954b949c16450427451d5ca74" - integrity sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ== - mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -7715,7 +7334,7 @@ ms@2.1.2, ms@^2.1.1, ms@^2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0, ms@^2.1.3: +ms@^2.0.0: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -8276,21 +7895,6 @@ ora@^4.0.4: strip-ansi "^6.0.0" wcwidth "^1.0.1" -ora@^5.2.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" - integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== - dependencies: - bl "^4.1.0" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-spinners "^2.5.0" - is-interactive "^1.0.0" - is-unicode-supported "^0.1.0" - log-symbols "^4.1.0" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -8319,13 +7923,6 @@ p-defer@^1.0.0: resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= -p-event@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/p-event/-/p-event-4.2.0.tgz#af4b049c8acd91ae81083ebd1e6f5cae2044c1b5" - integrity sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ== - dependencies: - p-timeout "^3.1.0" - p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -8417,7 +8014,7 @@ p-reduce@^2.0.0, p-reduce@^2.1.0: resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-2.1.0.tgz#09408da49507c6c274faa31f28df334bc712b64a" integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== -p-timeout@^3.1.0, p-timeout@^3.2.0: +p-timeout@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== @@ -8725,11 +8322,6 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - prettier@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" @@ -8742,13 +8334,6 @@ pretty-ms@^7.0.0: dependencies: parse-ms "^2.1.0" -pretty-ms@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8" - integrity sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q== - dependencies: - parse-ms "^2.1.0" - process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -8839,13 +8424,6 @@ pupa@^2.0.1: dependencies: escape-goat "^2.0.0" -pupa@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" - integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== - dependencies: - escape-goat "^2.0.0" - q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -9042,7 +8620,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.4.0, readable-stream@^3.6.0: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -9273,7 +8851,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.9.0: +resolve@^1.1.6, resolve@^1.14.2, resolve@^1.9.0: version "1.21.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.21.0.tgz#b51adc97f3472e6a5cf4444d34bc9d6b9037591f" integrity sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA== @@ -9356,16 +8934,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rollup-plugin-terser@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" - integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== - dependencies: - "@babel/code-frame" "^7.10.4" - jest-worker "^26.2.1" - serialize-javascript "^4.0.0" - terser "^5.0.0" - rollup@^1.32.0: version "1.32.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.32.1.tgz#4480e52d9d9e2ae4b46ba0d9ddeaf3163940f9c4" @@ -9375,13 +8943,6 @@ rollup@^1.32.0: "@types/node" "*" acorn "^7.1.0" -rollup@^2.22.0: - version "2.63.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.63.0.tgz#fe2f7fec2133f3fab9e022b9ac245628d817c6bb" - integrity sha512-nps0idjmD+NXl6OREfyYXMn/dar3WGcyKn+KBzPdaLecub3x/LrId0wUcthcr8oZUAcZAR8NKcfGGFlNgGL1kQ== - optionalDependencies: - fsevents "~2.3.2" - rsvp@^3.5.0: version "3.6.2" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" @@ -9544,20 +9105,6 @@ serialize-error@^2.1.0: resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-2.1.0.tgz#50b679d5635cdf84667bdc8e59af4e5b81d5f60a" integrity sha1-ULZ51WNc34Rme9yOWa9OW4HV9go= -serialize-error@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-7.0.1.tgz#f1360b0447f61ffb483ec4157c737fab7d778e18" - integrity sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw== - dependencies: - type-fest "^0.13.1" - -serialize-javascript@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" - integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== - dependencies: - randombytes "^2.1.0" - serialize-javascript@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" @@ -9854,11 +9401,6 @@ source-map@^0.7.3, source-map@~0.7.2: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -sourcemap-codec@^1.4.4: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -9950,13 +9492,6 @@ stack-utils@^2.0.2: dependencies: escape-string-regexp "^2.0.0" -stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== - dependencies: - escape-string-regexp "^2.0.0" - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -10010,15 +9545,6 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string-width@^4.2.2: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string.prototype.padend@^3.0.0: version "3.1.3" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz#997a6de12c92c7cb34dc8a201a6c53d9bd88a5f1" @@ -10086,13 +9612,6 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" -strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -10145,17 +9664,6 @@ supertap@^1.0.0: serialize-error "^2.1.0" strip-ansi "^4.0.0" -supertap@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supertap/-/supertap-2.0.0.tgz#8b587d6e14b8e885fa5183a9c45abf429feb9f7f" - integrity sha512-jRzcXlCeDYvKoZGA5oRhYyR3jUIYu0enkSxtmAgHRlD7HwrovTpH4bDSi0py9FtuA8si9cW/fKommJHuaoDHJA== - dependencies: - arrify "^2.0.1" - indent-string "^4.0.0" - js-yaml "^3.14.0" - serialize-error "^7.0.1" - strip-ansi "^6.0.0" - supports-color@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" @@ -10170,13 +9678,6 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^7.0.0, supports-color@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - supports-color@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" @@ -10184,6 +9685,13 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -10294,7 +9802,7 @@ terser-webpack-plugin@^5.1.3: source-map "^0.6.1" terser "^5.7.2" -terser@^5.0.0, terser@^5.7.2: +terser@^5.7.2: version "5.10.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc" integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA== @@ -10536,21 +10044,11 @@ type-fest@^0.11.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== -type-fest@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" - integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== - type-fest@^0.18.0: version "0.18.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - type-fest@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" @@ -10772,26 +10270,6 @@ update-notifier@^4.1.0: semver-diff "^3.1.1" xdg-basedir "^4.0.0" -update-notifier@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-5.1.0.tgz#4ab0d7c7f36a231dd7316cf7729313f0214d9ad9" - integrity sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw== - dependencies: - boxen "^5.0.0" - chalk "^4.1.0" - configstore "^5.0.1" - has-yarn "^2.1.0" - import-lazy "^2.1.0" - is-ci "^2.0.0" - is-installed-globally "^0.4.0" - is-npm "^5.0.0" - is-yarn-global "^0.3.0" - latest-version "^5.1.0" - pupa "^2.1.1" - semver "^7.3.4" - semver-diff "^3.1.1" - xdg-basedir "^4.0.0" - uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" From aa9a79ba612d4385e645a806d5aaddaf17b110f2 Mon Sep 17 00:00:00 2001 From: homura Date: Thu, 20 Jan 2022 15:51:06 +0800 Subject: [PATCH 2/2] style: prettier --- .../src/cell_collectors/rpc_collector.js | 6 +- packages/toolkit/src/normalizers.js | 49 +-- packages/toolkit/src/reader.js | 2 +- packages/toolkit/src/rpc.js | 20 +- packages/toolkit/src/transaction_dumper.js | 12 +- packages/toolkit/src/transformers.js | 60 ++-- packages/toolkit/src/validators.js | 36 +-- packages/toolkit/tests/serializers.js | 144 ++++----- packages/toolkit/tests/transformers.js | 278 +++++++++--------- packages/toolkit/tests/validators.js | 262 ++++++++--------- 10 files changed, 435 insertions(+), 434 deletions(-) diff --git a/packages/toolkit/src/cell_collectors/rpc_collector.js b/packages/toolkit/src/cell_collectors/rpc_collector.js index 3649610d0..fdcadcf7f 100644 --- a/packages/toolkit/src/cell_collectors/rpc_collector.js +++ b/packages/toolkit/src/cell_collectors/rpc_collector.js @@ -9,7 +9,7 @@ export class RPCCollector { { skipCellWithContent = true, loadData = false, - loadBlockNumber = true + loadBlockNumber = true, } = {} ) { this.rpc = rpc; @@ -62,13 +62,13 @@ export class RPCCollector { cell_output: { capacity: cell.capacity, lock: cell.lock, - type: cell.type + type: cell.type, }, out_point: cell.out_point, block_hash: cell.block_hash, data: data, output_data_len: cell.output_data_len, - block_number + block_number, }; } currentFrom = JSBI.add(currentTo, JSBI.BigInt(1)); diff --git a/packages/toolkit/src/normalizers.js b/packages/toolkit/src/normalizers.js index 4f0eaced0..eb9353f36 100644 --- a/packages/toolkit/src/normalizers.js +++ b/packages/toolkit/src/normalizers.js @@ -15,7 +15,7 @@ import { Reader } from "./reader"; import { BigIntToHexString } from "./rpc"; function normalizeHexNumber(length) { - return function(debugPath, value) { + return function (debugPath, value) { if (!(value instanceof ArrayBuffer)) { let intValue = BigIntToHexString(JSBI.BigInt(value)).substr(2); if (intValue.length % 2 !== 0) { @@ -23,8 +23,9 @@ function normalizeHexNumber(length) { } if (intValue.length / 2 > length) { throw new Error( - `${debugPath} is ${intValue.length / - 2} bytes long, expected length is ${length}!` + `${debugPath} is ${ + intValue.length / 2 + } bytes long, expected length is ${length}!` ); } const view = new DataView(new ArrayBuffer(length)); @@ -44,7 +45,7 @@ function normalizeHexNumber(length) { } function normalizeRawData(length) { - return function(debugPath, value) { + return function (debugPath, value) { value = new Reader(value).toArrayBuffer(); if (length > 0 && value.byteLength !== length) { throw new Error( @@ -71,7 +72,7 @@ function normalizeObject(debugPath, object, keys) { export function NormalizeScript(script, { debugPath = "script" } = {}) { return normalizeObject(debugPath, script, { code_hash: normalizeRawData(32), - hash_type: function(debugPath, value) { + hash_type: function (debugPath, value) { switch (value) { case "data": return 0; @@ -85,21 +86,21 @@ export function NormalizeScript(script, { debugPath = "script" } = {}) { throw new Error(`${debugPath}.hash_type has invalid value: ${value}`); } }, - args: normalizeRawData(-1) + args: normalizeRawData(-1), }); } export function NormalizeOutPoint(outPoint, { debugPath = "out_point" } = {}) { return normalizeObject(debugPath, outPoint, { tx_hash: normalizeRawData(32), - index: normalizeHexNumber(4) + index: normalizeHexNumber(4), }); } function toNormalize(normalize) { - return function(debugPath, value) { + return function (debugPath, value) { return normalize(value, { - debugPath + debugPath, }); }; } @@ -110,7 +111,7 @@ export function NormalizeCellInput( ) { return normalizeObject(debugPath, cellInput, { since: normalizeHexNumber(8), - previous_output: toNormalize(NormalizeOutPoint) + previous_output: toNormalize(NormalizeOutPoint), }); } @@ -120,11 +121,11 @@ export function NormalizeCellOutput( ) { const result = normalizeObject(debugPath, cellOutput, { capacity: normalizeHexNumber(8), - lock: toNormalize(NormalizeScript) + lock: toNormalize(NormalizeScript), }); if (cellOutput.type) { result.type_ = NormalizeScript(cellOutput.type, { - debugPath: `${debugPath}.type` + debugPath: `${debugPath}.type`, }); } return result; @@ -133,7 +134,7 @@ export function NormalizeCellOutput( export function NormalizeCellDep(cellDep, { debugPath = "cell_dep" } = {}) { return normalizeObject(debugPath, cellDep, { out_point: toNormalize(NormalizeOutPoint), - dep_type: function(debugPath, value) { + dep_type: function (debugPath, value) { switch (value) { case "code": return 0; @@ -146,12 +147,12 @@ export function NormalizeCellDep(cellDep, { debugPath = "cell_dep" } = {}) { default: throw new Error(`${debugPath}.dep_type has invalid value: ${value}`); } - } + }, }); } function toNormalizeArray(normalizeFunction) { - return function(debugPath, array) { + return function (debugPath, array) { return array.map((item, i) => { return normalizeFunction(`${debugPath}[${i}]`, item); }); @@ -168,7 +169,7 @@ export function NormalizeRawTransaction( header_deps: toNormalizeArray(normalizeRawData(32)), inputs: toNormalizeArray(toNormalize(NormalizeCellInput)), outputs: toNormalizeArray(toNormalize(NormalizeCellOutput)), - outputs_data: toNormalizeArray(normalizeRawData(-1)) + outputs_data: toNormalizeArray(normalizeRawData(-1)), }); } @@ -177,10 +178,10 @@ export function NormalizeTransaction( { debugPath = "transaction" } = {} ) { const rawTransaction = NormalizeRawTransaction(transaction, { - debugPath: `(raw)${debugPath}` + debugPath: `(raw)${debugPath}`, }); const result = normalizeObject(debugPath, transaction, { - witnesses: toNormalizeArray(normalizeRawData(-1)) + witnesses: toNormalizeArray(normalizeRawData(-1)), }); result.raw = rawTransaction; return result; @@ -200,16 +201,16 @@ export function NormalizeRawHeader( transactions_root: normalizeRawData(32), proposals_hash: normalizeRawData(32), uncles_hash: normalizeRawData(32), - dao: normalizeRawData(32) + dao: normalizeRawData(32), }); } export function NormalizeHeader(header, { debugPath = "header" } = {}) { const rawHeader = NormalizeRawHeader(header, { - debugPath: `(raw)${debugPath}` + debugPath: `(raw)${debugPath}`, }); const result = normalizeObject(debugPath, header, { - nonce: normalizeHexNumber(16) + nonce: normalizeHexNumber(16), }); result.raw = rawHeader; return result; @@ -221,7 +222,7 @@ export function NormalizeUncleBlock( ) { return normalizeObject(debugPath, uncleBlock, { header: toNormalize(NormalizeHeader), - proposals: toNormalizeArray(normalizeRawData(10)) + proposals: toNormalizeArray(normalizeRawData(10)), }); } @@ -230,7 +231,7 @@ export function NormalizeBlock(block, { debugPath = "block" } = {}) { header: toNormalize(NormalizeHeader), uncles: toNormalizeArray(toNormalize(NormalizeUncleBlock)), transactions: toNormalizeArray(toNormalize(NormalizeTransaction)), - proposals: toNormalizeArray(normalizeRawData(10)) + proposals: toNormalizeArray(normalizeRawData(10)), }); } @@ -240,7 +241,7 @@ export function NormalizeCellbaseWitness( ) { return normalizeObject(debugPath, cellbaseWitness, { lock: toNormalize(NormalizeScript), - message: normalizeRawData(-1) + message: normalizeRawData(-1), }); } diff --git a/packages/toolkit/src/reader.js b/packages/toolkit/src/reader.js index f8f73bf69..ca0965e30 100644 --- a/packages/toolkit/src/reader.js +++ b/packages/toolkit/src/reader.js @@ -19,7 +19,7 @@ class ArrayBufferReader { return ( "0x" + Array.prototype.map - .call(new Uint8Array(this.view.buffer), x => + .call(new Uint8Array(this.view.buffer), (x) => ("00" + x.toString(16)).slice(-2) ) .join("") diff --git a/packages/toolkit/src/rpc.js b/packages/toolkit/src/rpc.js index 495f0b091..aa72b3a15 100644 --- a/packages/toolkit/src/rpc.js +++ b/packages/toolkit/src/rpc.js @@ -9,7 +9,7 @@ function mergeOptions(overrideOptions, defaultOptions) { overrideOptions.headers || {} ); return Object.assign({}, defaultOptions, overrideOptions, { - headers: headers + headers: headers, }); } @@ -23,9 +23,9 @@ const batchHandler = { { method: "post", headers: { - "Content-Type": "application/json" + "Content-Type": "application/json", }, - body: JSON.stringify(target.payload) + body: JSON.stringify(target.payload), }, target.defaultOptions ) @@ -40,11 +40,11 @@ const batchHandler = { jsonrpc: "2.0", id: id, method: method, - params: params + params: params, }); return receiver; }; - } + }, }; const handler = { @@ -56,7 +56,7 @@ const handler = { id: Math.round(Math.random() * 10000000), payload: [], uri: target.uri, - defaultOptions: target.defaultOptions + defaultOptions: target.defaultOptions, }, batchHandler ); @@ -70,14 +70,14 @@ const handler = { { method: "post", headers: { - "Content-Type": "application/json" + "Content-Type": "application/json", }, body: JSON.stringify({ jsonrpc: "2.0", id: id, method: method, - params: params - }) + params: params, + }), }, target.defaultOptions ) @@ -93,7 +93,7 @@ const handler = { } return data.result; }; - } + }, }; export class RPC { diff --git a/packages/toolkit/src/transaction_dumper.js b/packages/toolkit/src/transaction_dumper.js index dba3c78b8..19c8d4c92 100644 --- a/packages/toolkit/src/transaction_dumper.js +++ b/packages/toolkit/src/transaction_dumper.js @@ -38,7 +38,7 @@ export class TransactionDumper { cell_dep: cellDep, output, data, - header + header, }); if (cellDep.dep_type === "dep_group") { if (!this.depGroupUnpacker) { @@ -55,11 +55,11 @@ export class TransactionDumper { mockCellDeps.push({ cell_dep: { out_point: outPoint, - dep_type: "code" + dep_type: "code", }, output, data, - header + header, }); } } @@ -72,9 +72,9 @@ export class TransactionDumper { mock_info: { inputs: mockInputs, cell_deps: mockCellDeps, - header_deps: mockHeaderDeps + header_deps: mockHeaderDeps, }, - tx + tx, }); } @@ -92,7 +92,7 @@ export class TransactionDumper { } const data = { output: tx.outputs[index], - data: tx.outputs_data[index] + data: tx.outputs_data[index], }; if (txStatus.tx_status.status === "committed") { data.header = txStatus.tx_status.block_hash; diff --git a/packages/toolkit/src/transformers.js b/packages/toolkit/src/transformers.js index ccab151fb..fdac9e20b 100644 --- a/packages/toolkit/src/transformers.js +++ b/packages/toolkit/src/transformers.js @@ -35,7 +35,7 @@ function transformObject(debugPath, object, keys) { for (const [key, f] of Object.entries(keys)) { let value = object[key]; if (!value) { - const camelKey = key.replace(/(_[a-z])/g, group => + const camelKey = key.replace(/(_[a-z])/g, (group) => group.toUpperCase().replace("_", "") ); value = object[camelKey]; @@ -54,12 +54,12 @@ export function TransformScript( script = transformObject(debugPath, script, { code_hash: invokeSerializeJson, hash_type: invokeSerializeJson, - args: invokeSerializeJson + args: invokeSerializeJson, }); if (validation) { validators.ValidateScript(script, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return script; @@ -71,22 +71,22 @@ export function TransformOutPoint( ) { outPoint = transformObject(debugPath, outPoint, { tx_hash: invokeSerializeJson, - index: invokeSerializeJson + index: invokeSerializeJson, }); if (validation) { validators.ValidateOutPoint(outPoint, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return outPoint; } function toInvoke(transform) { - return function(debugPath, value) { + return function (debugPath, value) { return transform(value, { validation: false, - debugPath + debugPath, }); }; } @@ -97,12 +97,12 @@ export function TransformCellInput( ) { cellInput = transformObject(debugPath, cellInput, { since: invokeSerializeJson, - previous_output: toInvoke(TransformOutPoint) + previous_output: toInvoke(TransformOutPoint), }); if (validation) { validators.ValidateCellInput(cellInput, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return cellInput; @@ -115,12 +115,12 @@ export function TransformCellOutput( cellOutput = transformObject(debugPath, cellOutput, { capacity: invokeSerializeJson, lock: toInvoke(TransformScript), - type: toInvoke(TransformScript) + type: toInvoke(TransformScript), }); if (validation) { validators.ValidateCellOutput(cellOutput, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return cellOutput; @@ -132,19 +132,19 @@ export function TransformCellDep( ) { cellDep = transformObject(debugPath, cellDep, { out_point: toInvoke(TransformOutPoint), - dep_type: invokeSerializeJson + dep_type: invokeSerializeJson, }); if (validation) { validators.ValidateCellDep(cellDep, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return cellDep; } function toInvokeArray(invokeFunction) { - return function(debugPath, array) { + return function (debugPath, array) { return array.map((item, i) => { return invokeFunction(`${debugPath}[${i}]`, item); }); @@ -161,12 +161,12 @@ export function TransformRawTransaction( header_deps: toInvokeArray(invokeSerializeJson), inputs: toInvokeArray(toInvoke(TransformCellInput)), outputs: toInvokeArray(toInvoke(TransformCellOutput)), - outputs_data: toInvokeArray(invokeSerializeJson) + outputs_data: toInvokeArray(invokeSerializeJson), }); if (validation) { validators.ValidateRawTransaction(rawTransaction, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return rawTransaction; @@ -183,12 +183,12 @@ export function TransformTransaction( inputs: toInvokeArray(toInvoke(TransformCellInput)), outputs: toInvokeArray(toInvoke(TransformCellOutput)), outputs_data: toInvokeArray(invokeSerializeJson), - witnesses: toInvokeArray(invokeSerializeJson) + witnesses: toInvokeArray(invokeSerializeJson), }); if (validation) { validators.ValidateTransaction(transaction, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return transaction; @@ -208,12 +208,12 @@ export function TransformRawHeader( transactions_root: invokeSerializeJson, proposals_hash: invokeSerializeJson, uncles_hash: invokeSerializeJson, - dao: invokeSerializeJson + dao: invokeSerializeJson, }); if (validation) { validators.ValidateRawHeader(rawHeader, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return rawHeader; @@ -234,12 +234,12 @@ export function TransformHeader( proposals_hash: invokeSerializeJson, uncles_hash: invokeSerializeJson, dao: invokeSerializeJson, - nonce: invokeSerializeJson + nonce: invokeSerializeJson, }); if (validation) { validators.ValidateHeader(header, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return header; @@ -251,12 +251,12 @@ export function TransformUncleBlock( ) { uncleBlock = transformObject(debugPath, uncleBlock, { header: toInvoke(TransformHeader), - proposals: toInvokeArray(invokeSerializeJson) + proposals: toInvokeArray(invokeSerializeJson), }); if (validation) { validators.ValidateUncleBlock(uncleBlock, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return uncleBlock; @@ -270,12 +270,12 @@ export function TransformBlock( header: toInvoke(TransformHeader), uncles: toInvokeArray(toInvoke(TransformUncleBlock)), transactions: toInvokeArray(toInvoke(TransformTransaction)), - proposals: toInvokeArray(invokeSerializeJson) + proposals: toInvokeArray(invokeSerializeJson), }); if (validation) { validators.ValidateBlock(block, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return block; @@ -287,12 +287,12 @@ export function TransformCellbaseWitness( ) { cellbaseWitness = transformObject(debugPath, cellbaseWitness, { lock: toInvoke(TransformScript), - message: invokeSerializeJson + message: invokeSerializeJson, }); if (validation) { validators.ValidateCellbaseWitness(cellbaseWitness, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return cellbaseWitness; @@ -305,12 +305,12 @@ export function TransformWitnessArgs( witnessArgs = transformObject(debugPath, witnessArgs, { lock: invokeSerializeJson, input_type: invokeSerializeJson, - output_type: invokeSerializeJson + output_type: invokeSerializeJson, }); if (validation) { validators.ValidateWitnessArgs(witnessArgs, { - debugPath: `(transformed) ${debugPath}` + debugPath: `(transformed) ${debugPath}`, }); } return witnessArgs; diff --git a/packages/toolkit/src/validators.js b/packages/toolkit/src/validators.js index 2c45e7765..9c3d44ed9 100644 --- a/packages/toolkit/src/validators.js +++ b/packages/toolkit/src/validators.js @@ -31,12 +31,12 @@ function assertObjectWithKeys( throw new Error(errorMessage); } let optionalProvidedKeys = providedKeys.filter( - key => !expectedKeys.includes(key) + (key) => !expectedKeys.includes(key) ); if (providedKeys.length - optionalProvidedKeys.length !== requiredLength) { throw new Error(errorMessage); } - if (optionalProvidedKeys.find(key => !optionalKeys.includes(key))) { + if (optionalProvidedKeys.find((key) => !optionalKeys.includes(key))) { throw new Error(errorMessage); } } @@ -49,7 +49,7 @@ function assertHexString(debugPath, string) { function assertHash(debugPath, hash) { assertHexString(debugPath, hash); - if (hash.length != 66) { + if (hash.length !== 66) { throw new Error(`${debugPath} must be a hex string of 66 bytes long!`); } } @@ -99,7 +99,7 @@ export function ValidateCellInput( if (nestedValidation) { ValidateOutPoint(cellInput.previous_output, { - debugPath: `${debugPath}.previous_output` + debugPath: `${debugPath}.previous_output`, }); } } @@ -113,11 +113,11 @@ export function ValidateCellOutput( if (nestedValidation) { ValidateScript(cellOutput.lock, { - debugPath: `${debugPath}.lock` + debugPath: `${debugPath}.lock`, }); if (cellOutput.type) { ValidateScript(cellOutput.type, { - debugPath: `${debugPath}.type` + debugPath: `${debugPath}.type`, }); } } @@ -134,7 +134,7 @@ export function ValidateCellDep( if (nestedValidation) { ValidateOutPoint(cellDep.out_point, { - debugPath: `${debugPath}.out_point` + debugPath: `${debugPath}.out_point`, }); } } @@ -151,10 +151,10 @@ function assertArray(debugPath, array, validateFunction, nestedValidation) { } function toAssert(validateFunction, nestedValidation) { - return function(debugPath, value) { + return function (debugPath, value) { validateFunction(value, { nestedValidation: nestedValidation, - debugPath: debugPath + debugPath: debugPath, }); }; } @@ -206,7 +206,7 @@ export function ValidateRawTransaction( "header_deps", "inputs", "outputs", - "outputs_data" + "outputs_data", ], [] ); @@ -227,7 +227,7 @@ export function ValidateTransaction( "inputs", "outputs", "outputs_data", - "witnesses" + "witnesses", ], [] ); @@ -270,7 +270,7 @@ export function ValidateRawHeader( "transactions_root", "proposals_hash", "uncles_hash", - "dao" + "dao", ], [] ); @@ -295,12 +295,12 @@ export function ValidateHeader( "proposals_hash", "uncles_hash", "dao", - "nonce" + "nonce", ], [] ); assertHexString(`${debugPath}.nonce`, header.nonce); - if (header.nonce.length != 34) { + if (header.nonce.length !== 34) { throw new Error( `${debugPath}.nonce must be a hex string of 34 bytes long!` ); @@ -309,7 +309,7 @@ export function ValidateHeader( function assertProposalShortId(debugPath, shortId) { assertHexString(debugPath, shortId); - if (shortId.length != 22) { + if (shortId.length !== 22) { throw new Error(`${debugPath} must be a hex string of 22 bytes long!`); } } @@ -322,7 +322,7 @@ export function ValidateUncleBlock( if (nestedValidation) { ValidateHeader(uncleBlock.header, { - debugPath: `${debugPath}.header` + debugPath: `${debugPath}.header`, }); } assertArray( @@ -346,7 +346,7 @@ export function ValidateBlock( if (nestedValidation) { ValidateHeader(block.header, { - debugPath: `${debugPath}.header` + debugPath: `${debugPath}.header`, }); } assertArray( @@ -378,7 +378,7 @@ export function ValidateCellbaseWitness( if (nestedValidation) { ValidateScript(cellbaseWitness.lock, { - debugPath: `${debugPath}.lock` + debugPath: `${debugPath}.lock`, }); } } diff --git a/packages/toolkit/tests/serializers.js b/packages/toolkit/tests/serializers.js index fdf79af8c..daa086184 100644 --- a/packages/toolkit/tests/serializers.js +++ b/packages/toolkit/tests/serializers.js @@ -2,12 +2,12 @@ const test = require("ava"); const { normalizers, Reader } = require("../lib"); const CKB = require("../testfiles/blockchain.umd.js"); -test("normalize and serialize script", t => { +test("normalize and serialize script", (t) => { const value = { code_hash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", args: "0xaabbccdd44332211", - hash_type: "type" + hash_type: "type", }; const normalizedValue = normalizers.NormalizeScript(value); const serializedValue = CKB.SerializeScript(normalizedValue); @@ -18,12 +18,12 @@ test("normalize and serialize script", t => { ); }); -test("normalize and serialize script with integer hash type", t => { +test("normalize and serialize script with integer hash type", (t) => { const value = { code_hash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", args: "0xaabbccdd44332211", - hash_type: 1 + hash_type: 1, }; const normalizedValue = normalizers.NormalizeScript(value); const serializedValue = CKB.SerializeScript(normalizedValue); @@ -34,35 +34,35 @@ test("normalize and serialize script with integer hash type", t => { ); }); -test("normalize invalid script", t => { +test("normalize invalid script", (t) => { const value = { code_hash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", args: "0xaabbccdd4433221", - hash_type: "type" + hash_type: "type", }; t.throws(() => { normalizers.NormalizeScript(value); }); }); -test("normalize invalid script type", t => { +test("normalize invalid script type", (t) => { const value = { code_hash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", args: "0xaabbccdd44332211", - hash_type: "invalidtype" + hash_type: "invalidtype", }; t.throws(() => { normalizers.NormalizeScript(value); }); }); -test("normalize and serialize outpoint", t => { +test("normalize and serialize outpoint", (t) => { const value = { tx_hash: "0x4565f957aa65ca5d094ede05cbeaedcee70f5a71200ae2e31b643d2952c929bc", - index: 3 + index: 3, }; const normalizedValue = normalizers.NormalizeOutPoint(value); const serializedValue = CKB.SerializeOutPoint(normalizedValue); @@ -73,11 +73,11 @@ test("normalize and serialize outpoint", t => { ); }); -test("normalize and serialize outpoint with hex number", t => { +test("normalize and serialize outpoint with hex number", (t) => { const value = { tx_hash: "0x4565f957aa65ca5d094ede05cbeaedcee70f5a71200ae2e31b643d2952c929bc", - index: "0x3" + index: "0x3", }; const normalizedValue = normalizers.NormalizeOutPoint(value); const serializedValue = CKB.SerializeOutPoint(normalizedValue); @@ -88,25 +88,25 @@ test("normalize and serialize outpoint with hex number", t => { ); }); -test("normalize invalid outpoint", t => { +test("normalize invalid outpoint", (t) => { const value = { tx_hash: "0x4565f957aa65ca5d094ede05cbeaedcee70f5a71200ae2e31b643d2952c929bc", - index: "0x123412341" + index: "0x123412341", }; t.throws(() => { normalizers.NormalizeOutPoint(value); }); }); -test("normalize and serialize cellinput", t => { +test("normalize and serialize cellinput", (t) => { const value = { since: "0x60a0001234", previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x10" - } + index: "0x10", + }, }; const normalizedValue = normalizers.NormalizeCellInput(value); const serializedValue = CKB.SerializeCellInput(normalizedValue); @@ -117,31 +117,31 @@ test("normalize and serialize cellinput", t => { ); }); -test("normalize invalid cellinput", t => { +test("normalize invalid cellinput", (t) => { const value = { since: "0x60a0001234", - previous_output: "hahah" + previous_output: "hahah", }; t.throws(() => { normalizers.NormalizeCellInput(value); }); }); -test("normalize and serialize celloutput", t => { +test("normalize and serialize celloutput", (t) => { const value = { capacity: "0x10", lock: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" + hash_type: "data", }, type: { code_hash: "0xa98c57135830e1b900000000f6c4b8870828199a786b26f09f7dec4bc27a73db", args: "0x", - hash_type: "type" - } + hash_type: "type", + }, }; const normalizedValue = normalizers.NormalizeCellOutput(value); const serializedValue = CKB.SerializeCellOutput(normalizedValue); @@ -152,15 +152,15 @@ test("normalize and serialize celloutput", t => { ); }); -test("normalize and serialize celloutput without type", t => { +test("normalize and serialize celloutput without type", (t) => { const value = { capacity: "0x10", lock: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" - } + hash_type: "data", + }, }; const normalizedValue = normalizers.NormalizeCellOutput(value); const serializedValue = CKB.SerializeCellOutput(normalizedValue); @@ -171,29 +171,29 @@ test("normalize and serialize celloutput without type", t => { ); }); -test("normalize invalid celloutput", t => { +test("normalize invalid celloutput", (t) => { const value = { capacity: "0x102030405060708090", lock: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" - } + hash_type: "data", + }, }; t.throws(() => { normalizers.NormalizeCellOutput(value); }); }); -test("normalize and serialize celldep", t => { +test("normalize and serialize celldep", (t) => { const value = { dep_type: "code", out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x11" - } + index: "0x11", + }, }; const normalizedValue = normalizers.NormalizeCellDep(value); const serializedValue = CKB.SerializeCellDep(normalizedValue); @@ -204,7 +204,7 @@ test("normalize and serialize celldep", t => { ); }); -test("normalize and serialize transaction", t => { +test("normalize and serialize transaction", (t) => { const value = { version: "0x0", cell_deps: [ @@ -213,12 +213,12 @@ test("normalize and serialize transaction", t => { out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", - index: "0x0" - } - } + index: "0x0", + }, + }, ], header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -226,9 +226,9 @@ test("normalize and serialize transaction", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", - index: "0x2" - } - } + index: "0x2", + }, + }, ], outputs: [ { @@ -237,12 +237,12 @@ test("normalize and serialize transaction", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", args: "0x1234", - hash_type: "data" - } - } + hash_type: "data", + }, + }, ], outputs_data: ["0xabcdef"], - witnesses: ["0x31313131"] + witnesses: ["0x31313131"], }; const normalizedValue = normalizers.NormalizeTransaction(value); const serializedValue = CKB.SerializeTransaction(normalizedValue); @@ -253,7 +253,7 @@ test("normalize and serialize transaction", t => { ); }); -test("normalize and serialize header", t => { +test("normalize and serialize header", (t) => { const value = { compact_target: "0x1a2d3494", number: "0xfb1bc", @@ -269,7 +269,7 @@ test("normalize and serialize header", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }; const normalizedValue = normalizers.NormalizeHeader(value); const serializedValue = CKB.SerializeHeader(normalizedValue); @@ -280,7 +280,7 @@ test("normalize and serialize header", t => { ); }); -test("normalize and serialize uncle block", t => { +test("normalize and serialize uncle block", (t) => { const value = { header: { compact_target: "0x1a2d3494", @@ -297,9 +297,9 @@ test("normalize and serialize uncle block", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }, - proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"], }; const normalizedValue = normalizers.NormalizeUncleBlock(value); const serializedValue = CKB.SerializeUncleBlock(normalizedValue); @@ -310,7 +310,7 @@ test("normalize and serialize uncle block", t => { ); }); -test("normalize and serialize block", t => { +test("normalize and serialize block", (t) => { const value = { header: { compact_target: "0x1a2d3494", @@ -327,7 +327,7 @@ test("normalize and serialize block", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }, transactions: [ { @@ -338,12 +338,12 @@ test("normalize and serialize block", t => { out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", - index: "0x0" - } - } + index: "0x0", + }, + }, ], header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -351,9 +351,9 @@ test("normalize and serialize block", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", - index: "0x2" - } - } + index: "0x2", + }, + }, ], outputs: [ { @@ -362,16 +362,16 @@ test("normalize and serialize block", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", args: "0x1234", - hash_type: "data" - } - } + hash_type: "data", + }, + }, ], outputs_data: ["0xabcdef"], - witnesses: ["0x1111"] - } + witnesses: ["0x1111"], + }, ], uncles: [], - proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"], }; const normalizedValue = normalizers.NormalizeBlock(value); const serializedValue = CKB.SerializeBlock(normalizedValue); @@ -382,15 +382,15 @@ test("normalize and serialize block", t => { ); }); -test("normalize and serialize cellbase witness", t => { +test("normalize and serialize cellbase witness", (t) => { const value = { lock: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" + hash_type: "data", }, - message: "0x1234abcdef" + message: "0x1234abcdef", }; const normalizedValue = normalizers.NormalizeCellbaseWitness(value); const serializedValue = CKB.SerializeCellbaseWitness(normalizedValue); @@ -401,11 +401,11 @@ test("normalize and serialize cellbase witness", t => { ); }); -test("normalize and serialize witness args", t => { +test("normalize and serialize witness args", (t) => { const value = { lock: "0x1234", input_type: "0x4678", - output_type: "0x2312" + output_type: "0x2312", }; const normalizedValue = normalizers.NormalizeWitnessArgs(value); const serializedValue = CKB.SerializeWitnessArgs(normalizedValue); @@ -416,7 +416,7 @@ test("normalize and serialize witness args", t => { ); }); -test("normalize and serialize empty witness args", t => { +test("normalize and serialize empty witness args", (t) => { const value = {}; const normalizedValue = normalizers.NormalizeWitnessArgs(value); const serializedValue = CKB.SerializeWitnessArgs(normalizedValue); @@ -424,9 +424,9 @@ test("normalize and serialize empty witness args", t => { t.deepEqual(serializedHex, "0x10000000100000001000000010000000"); }); -test("normalize and serialize only one witness args", t => { +test("normalize and serialize only one witness args", (t) => { const value = { - lock: "0x1234" + lock: "0x1234", }; const normalizedValue = normalizers.NormalizeWitnessArgs(value); const serializedValue = CKB.SerializeWitnessArgs(normalizedValue); diff --git a/packages/toolkit/tests/transformers.js b/packages/toolkit/tests/transformers.js index d6d6b3917..8ae4935f4 100644 --- a/packages/toolkit/tests/transformers.js +++ b/packages/toolkit/tests/transformers.js @@ -1,76 +1,76 @@ const test = require("ava"); const { transformers, Reader } = require("../lib"); -test("transform script", t => { +test("transform script", (t) => { const s = transformers.TransformScript({ code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: Reader.fromRawString("args1234"), hash_type: { - serializeJson: () => "data" - } + serializeJson: () => "data", + }, }); t.deepEqual(s, { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x6172677331323334", - hash_type: "data" + hash_type: "data", }); }); -test("transform camel case script", t => { +test("transform camel case script", (t) => { const s = transformers.TransformScript({ codeHash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: Reader.fromRawString("args1234"), hashType: { - serializeJson: () => "data" - } + serializeJson: () => "data", + }, }); t.deepEqual(s, { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x6172677331323334", - hash_type: "data" + hash_type: "data", }); }); -test("transform plain script", t => { +test("transform plain script", (t) => { const s = transformers.TransformScript({ code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" + hash_type: "data", }); t.deepEqual(s, { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" + hash_type: "data", }); }); -test("transform invalid script", t => { +test("transform invalid script", (t) => { t.throws(() => { transformers.TransformScript({ code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0xgghh", - hash_type: "data" + hash_type: "data", }); }); }); -test("transform invalid script but do not validate", t => { +test("transform invalid script but do not validate", (t) => { const s = transformers.TransformScript( { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0xgghh", - hash_type: "data" + hash_type: "data", }, { validation: false } ); @@ -79,50 +79,50 @@ test("transform invalid script but do not validate", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0xgghh", - hash_type: "data" + hash_type: "data", }); }); -test("transform outpoint", t => { +test("transform outpoint", (t) => { const o = transformers.TransformOutPoint({ tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x0" + index: "0x0", }); t.deepEqual(o, { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x0" + index: "0x0", }); }); -test("transform outpoint more fields", t => { +test("transform outpoint more fields", (t) => { const o = transformers.TransformOutPoint({ tx_hash: { serializeJson: () => "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - anotherfield: "not used" + anotherfield: "not used", }, index: "0x10", - unneeded: "unneeded field" + unneeded: "unneeded field", }); t.deepEqual(o, { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x10" + index: "0x10", }); }); -test("correct cellinput", t => { +test("correct cellinput", (t) => { const v = transformers.TransformCellInput({ since: "0x0", previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: new Reader("0x10") - } + index: new Reader("0x10"), + }, }); t.deepEqual(v, { @@ -130,24 +130,24 @@ test("correct cellinput", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x10" - } + index: "0x10", + }, }); }); -test("correct cellinput with serialize function using this", t => { +test("correct cellinput with serialize function using this", (t) => { const v = transformers.TransformCellInput({ since: "0x0", previous_output: { value: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x10" + index: "0x10", }, - serializeJson: function() { + serializeJson: function () { return this.value; - } - } + }, + }, }); t.deepEqual(v, { @@ -155,25 +155,25 @@ test("correct cellinput with serialize function using this", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x10" - } + index: "0x10", + }, }); }); -test("invalid cellinput", t => { +test("invalid cellinput", (t) => { t.throws(() => { transformers.TransformCellInput({ since: "0x0", previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: new Reader("0x00") - } + index: new Reader("0x00"), + }, }); }); }); -test("celloutput with type", t => { +test("celloutput with type", (t) => { const v = transformers.TransformCellOutput({ capacity: "0x10", lock: { @@ -181,18 +181,18 @@ test("celloutput with type", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: new Reader("0x1234"), - hash_type: "data" + hash_type: "data", }, - serializeJson: function() { + serializeJson: function () { return this.value; - } + }, }, type: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "type" - } + hash_type: "type", + }, }); t.deepEqual(v, { @@ -201,26 +201,26 @@ test("celloutput with type", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" + hash_type: "data", }, type: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "type" - } + hash_type: "type", + }, }); }); -test("celloutput", t => { +test("celloutput", (t) => { const v = transformers.TransformCellOutput({ capacity: "0x1024", lock: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "type" - } + hash_type: "type", + }, }); t.deepEqual(v, { @@ -229,12 +229,12 @@ test("celloutput", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "type" - } + hash_type: "type", + }, }); }); -test("celloutput invalid lock but skip validation", t => { +test("celloutput invalid lock but skip validation", (t) => { const v = transformers.TransformCellOutput( { capacity: "0x1024", @@ -242,9 +242,9 @@ test("celloutput invalid lock but skip validation", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "type" + hash_type: "type", }, - unused: "value" + unused: "value", }, { validation: false } ); @@ -255,12 +255,12 @@ test("celloutput invalid lock but skip validation", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "type" - } + hash_type: "type", + }, }); }); -test("celloutput invalid lock", t => { +test("celloutput invalid lock", (t) => { t.throws(() => { transformers.TransformCellOutput({ capacity: "0x1024", @@ -268,24 +268,24 @@ test("celloutput invalid lock", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "type" - } + hash_type: "type", + }, }); }); }); -test("correct celldep", t => { +test("correct celldep", (t) => { const v = transformers.TransformCellDep({ dep_type: { serializeJson: () => { return "code"; - } + }, }, out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x0" - } + index: "0x0", + }, }); t.deepEqual(v, { @@ -293,8 +293,8 @@ test("correct celldep", t => { out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x0" - } + index: "0x0", + }, }); }); @@ -308,7 +308,7 @@ class DummyValueHolder { } } -test("correct transaction", t => { +test("correct transaction", (t) => { const v = transformers.TransformTransaction({ version: "0x0", cell_deps: [ @@ -317,17 +317,17 @@ test("correct transaction", t => { out_point: { tx_hash: { value: "0xa98c57135830e1b91345948df6c4b887082819", - serializeJson: function() { + serializeJson: function () { return this.value + "9a786b26f09f7dec4bc27a7300"; - } + }, }, - index: "0x0" + index: "0x0", }, - redundant_key: "unused value" - } + redundant_key: "unused value", + }, ], header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -338,10 +338,10 @@ test("correct transaction", t => { index: { serializeJson: () => { return "0x2"; - } - } - } - } + }, + }, + }, + }, ], outputs: [ { @@ -350,12 +350,12 @@ test("correct transaction", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", args: new Reader("0x1234"), - hash_type: "data" - } - } + hash_type: "data", + }, + }, ], outputs_data: ["0xabcdef"], - witnesses: [Reader.fromRawString("1111")] + witnesses: [Reader.fromRawString("1111")], }); t.deepEqual(v, { @@ -366,12 +366,12 @@ test("correct transaction", t => { out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", - index: "0x0" - } - } + index: "0x0", + }, + }, ], header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -379,9 +379,9 @@ test("correct transaction", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", - index: "0x2" - } - } + index: "0x2", + }, + }, ], outputs: [ { @@ -390,16 +390,16 @@ test("correct transaction", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", args: "0x1234", - hash_type: "data" - } - } + hash_type: "data", + }, + }, ], outputs_data: ["0xabcdef"], - witnesses: ["0x31313131"] + witnesses: ["0x31313131"], }); }); -test("correct header", t => { +test("correct header", (t) => { const v = transformers.TransformHeader({ compact_target: "0x1a2d3494", number: "0xfb1bc", @@ -416,7 +416,7 @@ test("correct header", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }); t.deepEqual(v, { @@ -434,11 +434,11 @@ test("correct header", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }); }); -test("invalid header", t => { +test("invalid header", (t) => { t.throws(() => { transformers.TransformHeader({ compact_target: "0x1a2d3494", @@ -455,12 +455,12 @@ test("invalid header", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287a", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }); }); }); -test("correct block", t => { +test("correct block", (t) => { const v = transformers.TransformBlock({ header: { compact_target: "0x1a2d3494", @@ -477,7 +477,7 @@ test("correct block", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }, transactions: [ { @@ -489,12 +489,12 @@ test("correct block", t => { tx_hash: new Reader( "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300" ), - index: "0x0" - } - } + index: "0x0", + }, + }, ], header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -502,9 +502,9 @@ test("correct block", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", - index: "0x2" - } - } + index: "0x2", + }, + }, ], outputs: [ { @@ -516,17 +516,17 @@ test("correct block", t => { hash_type: { serializeJson: () => { return "data"; - } - } - } - } + }, + }, + }, + }, ], outputs_data: ["0xabcdef"], - witnesses: ["0x1111"] - } + witnesses: ["0x1111"], + }, ], uncles: [], - proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"], }); t.deepEqual(v, { @@ -545,7 +545,7 @@ test("correct block", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }, transactions: [ { @@ -556,12 +556,12 @@ test("correct block", t => { out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", - index: "0x0" - } - } + index: "0x0", + }, + }, ], header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -569,9 +569,9 @@ test("correct block", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", - index: "0x2" - } - } + index: "0x2", + }, + }, ], outputs: [ { @@ -580,30 +580,30 @@ test("correct block", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", args: "0x1234", - hash_type: "data" - } - } + hash_type: "data", + }, + }, ], outputs_data: ["0xabcdef"], - witnesses: ["0x1111"] - } + witnesses: ["0x1111"], + }, ], uncles: [], - proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"], }); }); -test("correct cellbase witness", t => { +test("correct cellbase witness", (t) => { const v = transformers.TransformCellbaseWitness({ lock: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", hash_type: "data", - unneeded1: "unneeded1" + unneeded1: "unneeded1", }, message: "0x1234abcdef", - unneeded2: 2 + unneeded2: 2, }); t.deepEqual(v, { @@ -611,39 +611,39 @@ test("correct cellbase witness", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" + hash_type: "data", }, - message: "0x1234abcdef" + message: "0x1234abcdef", }); }); -test("correct witness args", t => { +test("correct witness args", (t) => { const v = transformers.TransformWitnessArgs({ lock: "0x1234", input_type: "0x4678", - output_type: "0x2312" + output_type: "0x2312", }); t.deepEqual(v, { lock: "0x1234", input_type: "0x4678", - output_type: "0x2312" + output_type: "0x2312", }); }); -test("empty witness args", t => { +test("empty witness args", (t) => { const v = transformers.TransformWitnessArgs({}); t.deepEqual(v, {}); }); -test("only one witness args", t => { +test("only one witness args", (t) => { const v = transformers.TransformWitnessArgs({ lock: "0x1234", - unneeded: "unneeded123" + unneeded: "unneeded123", }); t.deepEqual(v, { - lock: "0x1234" + lock: "0x1234", }); }); diff --git a/packages/toolkit/tests/validators.js b/packages/toolkit/tests/validators.js index 424a39f8d..395c2039b 100644 --- a/packages/toolkit/tests/validators.js +++ b/packages/toolkit/tests/validators.js @@ -1,185 +1,185 @@ const test = require("ava"); const { validators } = require("../lib"); -test("correct script should pass validation", t => { +test("correct script should pass validation", (t) => { validators.ValidateScript({ code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" + hash_type: "data", }); t.pass(); }); -test("correct script with empty args", t => { +test("correct script with empty args", (t) => { validators.ValidateScript({ code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "type" + hash_type: "type", }); t.pass(); }); -test("script that is not object", t => { +test("script that is not object", (t) => { t.throws(() => { validators.ValidateScript("i am a script, trust me"); }); }); -test("script with invalid code hash", t => { +test("script with invalid code hash", (t) => { t.throws(() => { validators.ValidateScript({ code_hash: "0xa98c57135830e1b913", args: "0x", - hash_type: "type" + hash_type: "type", }); }); }); -test("script with invalid args", t => { +test("script with invalid args", (t) => { t.throws(() => { validators.ValidateScript({ code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0xthisisnothex", - hash_type: "type" + hash_type: "type", }); }); }); -test("script with invalid hash type", t => { +test("script with invalid hash type", (t) => { t.throws(() => { validators.ValidateScript({ code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "code" + hash_type: "code", }); }); }); -test("correct outpoint", t => { +test("correct outpoint", (t) => { validators.ValidateOutPoint({ tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x0" + index: "0x0", }); t.pass(); }); -test("correct outpoint with positive number", t => { +test("correct outpoint with positive number", (t) => { validators.ValidateOutPoint({ tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x101" + index: "0x101", }); t.pass(); }); -test("outpoint with zero leaded invalid number", t => { +test("outpoint with zero leaded invalid number", (t) => { t.throws(() => { validators.ValidateOutPoint({ tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x010" + index: "0x010", }); }); }); -test("outpoint with invalid hex number", t => { +test("outpoint with invalid hex number", (t) => { t.throws(() => { validators.ValidateOutPoint({ tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0xgg1" + index: "0xgg1", }); }); }); -test("correct cellinput", t => { +test("correct cellinput", (t) => { validators.ValidateCellInput({ since: "0x10", previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x0" - } + index: "0x0", + }, }); t.pass(); }); -test("cellinput with invalid since", t => { +test("cellinput with invalid since", (t) => { t.throws(() => { validators.ValidateCellInput({ since: "0x0001", previous_output: { tx_hash: "0xa98c57135830e1b91345948df", - index: "0x0" - } + index: "0x0", + }, }); }); }); -test("cellinput with invalid outpoint", t => { +test("cellinput with invalid outpoint", (t) => { t.throws(() => { validators.ValidateCellInput({ since: "0x0", previous_output: { tx_hash: "0xa98c57135830e1b91345948df", - index: "0x0" - } + index: "0x0", + }, }); }); }); -test("cellinput with invalid outpoint but skip nested validation", t => { +test("cellinput with invalid outpoint but skip nested validation", (t) => { validators.ValidateCellInput( { since: "0x0", previous_output: { tx_hash: "0xa98c57135830e1b91345948df", - index: "0x0" - } + index: "0x0", + }, }, { nestedValidation: false } ); t.pass(); }); -test("correct celloutput", t => { +test("correct celloutput", (t) => { validators.ValidateCellOutput({ capacity: "0x10", lock: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" - } + hash_type: "data", + }, }); t.pass(); }); -test("correct celloutput with type", t => { +test("correct celloutput with type", (t) => { validators.ValidateCellOutput({ capacity: "0x10", lock: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" + hash_type: "data", }, type: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x", - hash_type: "type" - } + hash_type: "type", + }, }); t.pass(); }); -test("celloutput with invalid capacity", t => { +test("celloutput with invalid capacity", (t) => { t.throws(() => { validators.ValidateCellOutput({ capacity: "0xggg", @@ -187,82 +187,82 @@ test("celloutput with invalid capacity", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" - } + hash_type: "data", + }, }); }); }); -test("celloutput with invalid lock", t => { +test("celloutput with invalid lock", (t) => { t.throws(() => { validators.ValidateCellOutput({ capacity: "0x10", lock: { - invalid: "lock" - } + invalid: "lock", + }, }); }); }); -test("celloutput with invalid lock but skips validation", t => { +test("celloutput with invalid lock but skips validation", (t) => { validators.ValidateCellOutput( { capacity: "0x10", lock: { - invalid: "lock" - } + invalid: "lock", + }, }, { nestedValidation: false } ); t.pass(); }); -test("correct celldep", t => { +test("correct celldep", (t) => { validators.ValidateCellDep({ dep_type: "code", out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x0" - } + index: "0x0", + }, }); t.pass(); }); -test("celldep with invalid dep type", t => { +test("celldep with invalid dep type", (t) => { t.throws(() => { validators.ValidateCellDep({ dep_type: "data", out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", - index: "0x0" - } + index: "0x0", + }, }); }); }); -test("celldep with invalid out point", t => { +test("celldep with invalid out point", (t) => { t.throws(() => { validators.ValidateCellDep({ dep_type: "dep_group", - out_point: "invalid out point" + out_point: "invalid out point", }); }); }); -test("celldep with invalid out point but skips validation", t => { +test("celldep with invalid out point but skips validation", (t) => { validators.ValidateCellDep( { dep_type: "dep_group", - out_point: "invalid out point" + out_point: "invalid out point", }, { nestedValidation: false } ); t.pass(); }); -test("correct raw transaction", t => { +test("correct raw transaction", (t) => { validators.ValidateRawTransaction({ version: "0x0", cell_deps: [ @@ -271,12 +271,12 @@ test("correct raw transaction", t => { out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", - index: "0x0" - } - } + index: "0x0", + }, + }, ], header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -284,9 +284,9 @@ test("correct raw transaction", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", - index: "0x2" - } - } + index: "0x2", + }, + }, ], outputs: [ { @@ -295,22 +295,22 @@ test("correct raw transaction", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", args: "0x1234", - hash_type: "data" - } - } + hash_type: "data", + }, + }, ], - outputs_data: ["0xabcdef"] + outputs_data: ["0xabcdef"], }); t.pass(); }); -test("invalid raw transaction", t => { +test("invalid raw transaction", (t) => { t.throws(() => { validators.ValidateRawTransaction({ version: "0x0", cell_deps: "invalid", header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -318,9 +318,9 @@ test("invalid raw transaction", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", - index: "0x2" - } - } + index: "0x2", + }, + }, ], outputs: [ { @@ -329,16 +329,16 @@ test("invalid raw transaction", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", args: "0x1234", - hash_type: "data" - } - } + hash_type: "data", + }, + }, ], - outputs_data: ["0xabcdef"] + outputs_data: ["0xabcdef"], }); }); }); -test("correct transaction", t => { +test("correct transaction", (t) => { validators.ValidateTransaction({ version: "0x0", cell_deps: [ @@ -347,12 +347,12 @@ test("correct transaction", t => { out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", - index: "0x0" - } - } + index: "0x0", + }, + }, ], header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -360,9 +360,9 @@ test("correct transaction", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", - index: "0x2" - } - } + index: "0x2", + }, + }, ], outputs: [ { @@ -371,17 +371,17 @@ test("correct transaction", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", args: "0x1234", - hash_type: "data" - } - } + hash_type: "data", + }, + }, ], outputs_data: ["0xabcdef"], - witnesses: ["0x1111"] + witnesses: ["0x1111"], }); t.pass(); }); -test("correct header", t => { +test("correct header", (t) => { validators.ValidateHeader({ compact_target: "0x1a2d3494", number: "0xfb1bc", @@ -397,12 +397,12 @@ test("correct header", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }); t.pass(); }); -test("invalid header", t => { +test("invalid header", (t) => { t.throws(() => { validators.ValidateHeader({ compact_target: "0x1a2d3494", @@ -419,12 +419,12 @@ test("invalid header", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }); }); }); -test("invalid raw header", t => { +test("invalid raw header", (t) => { t.throws(() => { validators.ValidateRawHeader({ compact_target: "0x1a2d3494", @@ -441,12 +441,12 @@ test("invalid raw header", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }); }); }); -test("validate uncle block", t => { +test("validate uncle block", (t) => { validators.ValidateUncleBlock({ header: { compact_target: "0x1a2d3494", @@ -463,14 +463,14 @@ test("validate uncle block", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }, - proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"], }); t.pass(); }); -test("validate invalid uncle block", t => { +test("validate invalid uncle block", (t) => { t.throws(() => { validators.ValidateUncleBlock({ header: { @@ -489,25 +489,25 @@ test("validate invalid uncle block", t => { version: "0x0", epoch: "0x7080612000287", dao: - "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }, - proposals: ["0x12345678901234567890", "0xabcdeabcdeab"] + proposals: ["0x12345678901234567890", "0xabcdeabcdeab"], }); }); }); -test("validate invalid uncle block but skips nested validation", t => { +test("validate invalid uncle block but skips nested validation", (t) => { validators.ValidateUncleBlock( { header: 123123, - proposals: ["0x12345678901234567890"] + proposals: ["0x12345678901234567890"], }, { nestedValidation: false } ); t.pass(); }); -test("validate block", t => { +test("validate block", (t) => { validators.ValidateBlock({ header: { compact_target: "0x1a2d3494", @@ -524,7 +524,7 @@ test("validate block", t => { "0x0000000000000000000000000000000000000000000000000000000000000000", version: "0x0", epoch: "0x7080612000287", - dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107", }, transactions: [ { @@ -535,12 +535,12 @@ test("validate block", t => { out_point: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", - index: "0x0" - } - } + index: "0x0", + }, + }, ], header_deps: [ - "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6", ], inputs: [ { @@ -548,9 +548,9 @@ test("validate block", t => { previous_output: { tx_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", - index: "0x2" - } - } + index: "0x2", + }, + }, ], outputs: [ { @@ -559,67 +559,67 @@ test("validate block", t => { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", args: "0x1234", - hash_type: "data" - } - } + hash_type: "data", + }, + }, ], outputs_data: ["0xabcdef"], - witnesses: ["0x1111"] - } + witnesses: ["0x1111"], + }, ], uncles: [], - proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"], }); t.pass(); }); -test("correct cellbase witness", t => { +test("correct cellbase witness", (t) => { validators.ValidateCellbaseWitness({ lock: { code_hash: "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", args: "0x1234", - hash_type: "data" + hash_type: "data", }, - message: "0x1234abcdef" + message: "0x1234abcdef", }); t.pass(); }); -test("correct witness args", t => { +test("correct witness args", (t) => { validators.ValidateWitnessArgs({ lock: "0x1234", input_type: "0x4678", - output_type: "0x2312" + output_type: "0x2312", }); t.pass(); }); -test("empty witness args", t => { +test("empty witness args", (t) => { validators.ValidateWitnessArgs({}); t.pass(); }); -test("only one witness args", t => { +test("only one witness args", (t) => { validators.ValidateWitnessArgs({ - lock: "0x1234" + lock: "0x1234", }); t.pass(); }); -test("invalid witness args", t => { +test("invalid witness args", (t) => { t.throws(() => { validators.ValidateWitnessArgs({ lock: "0x1234", - invalidkey: "0x1232" + invalidkey: "0x1232", }); }); }); -test("invalid witness args content", t => { +test("invalid witness args content", (t) => { t.throws(() => { validators.ValidateWitnessArgs({ - lock: "0x1234gg" + lock: "0x1234gg", }); }); });