Quellcode durchsuchen

Merge branch 'pioneer-antioch' into antioch-integration-tests

Mokhtar Naamani vor 4 Jahren
Ursprung
Commit
cc7996c11e

+ 1 - 1
cli/README.md

@@ -44,7 +44,7 @@ $ npm install -g @joystream/cli
 $ joystream-cli COMMAND
 running command...
 $ joystream-cli (-v|--version|version)
-@joystream/cli/0.3.2 linux-x64 node-v13.12.0
+@joystream/cli/0.4.0 linux-x64 node-v13.12.0
 $ joystream-cli --help [COMMAND]
 USAGE
   $ joystream-cli COMMAND

+ 5 - 5
cli/package.json

@@ -1,7 +1,7 @@
 {
   "name": "@joystream/cli",
   "description": "Command Line Interface for Joystream community and governance activities",
-  "version": "0.3.2",
+  "version": "0.4.0",
   "author": "Leszek Wiesner",
   "bin": {
     "joystream-cli": "./bin/run"
@@ -10,15 +10,15 @@
   "dependencies": {
     "@apidevtools/json-schema-ref-parser": "^9.0.6",
     "@ffprobe-installer/ffprobe": "^1.1.0",
-    "@joystream/types": "^0.14.0",
-    "@joystream/cd-schemas": "^0.1.0",
+    "@joystream/types": "^0.15.0",
+    "@joystream/cd-schemas": "^0.2.0",
     "@oclif/command": "^1.5.19",
     "@oclif/config": "^1.14.0",
     "@oclif/plugin-autocomplete": "^0.2.0",
     "@oclif/plugin-help": "^2.2.3",
     "@oclif/plugin-not-found": "^1.2.4",
     "@oclif/plugin-warn-if-update-available": "^1.7.0",
-    "@polkadot/api": "1.26.1",
+    "@polkadot/api": "4.2.1",
     "@types/fluent-ffmpeg": "^2.1.16",
     "@types/inquirer": "^6.5.0",
     "@types/proper-lockfile": "^4.1.1",
@@ -44,7 +44,7 @@
   "devDependencies": {
     "@oclif/dev-cli": "^1.22.2",
     "@oclif/test": "^1.2.5",
-    "@polkadot/ts": "^0.1.56",
+    "@polkadot/ts": "^0.3.62",
     "@types/chai": "^4.2.11",
     "@types/mocha": "^5.2.7",
     "@types/node": "^10.17.18",

+ 2 - 1
cli/src/Api.ts

@@ -79,7 +79,8 @@ export default class Api {
     metadataCache: Record<string, any>
   ): Promise<ApiPromise> {
     const wsProvider: WsProvider = new WsProvider(apiUri)
-    const api = await ApiPromise.create({ provider: wsProvider, types, metadata: metadataCache })
+    const api = new ApiPromise({ provider: wsProvider, types, metadata: metadataCache })
+    await api.isReadyOrError
 
     // Initializing some api params based on pioneer/packages/react-api/Api.tsx
     const [properties] = await Promise.all([api.rpc.system.properties()])

+ 4 - 4
content-directory-schemas/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@joystream/cd-schemas",
-  "version": "0.1.0",
+  "version": "0.2.0",
   "description": "JSON schemas, inputs and related tooling for Joystream content directory 2.0",
   "author": "Joystream contributors",
   "main": "lib/index.js",
@@ -26,9 +26,9 @@
   "dependencies": {
     "ajv": "6.12.5",
     "@joystream/prettier-config": "*",
-    "@polkadot/api": "1.26.1",
-    "@polkadot/keyring": "^3.0.1",
-    "@joystream/types": "^0.14.0",
+    "@polkadot/api": "4.2.1",
+    "@polkadot/keyring": "^6.0.5",
+    "@joystream/types": "^0.15.0",
     "@apidevtools/json-schema-ref-parser": "^9.0.6"
   },
   "devDependencies": {

+ 1 - 1
pioneer/package.json

@@ -34,7 +34,7 @@
     "@babel/runtime": "^7.10.5",
     "@pinata/sdk": "^1.1.10",
     "@polkadot/dev": "^0.55.28",
-    "@polkadot/ts": "^0.3.29",
+    "@polkadot/ts": "^0.3.62",
     "@types/bn.js": "^4.11.6",
     "@types/chart.js": "^2.9.23",
     "@types/file-saver": "^2.0.1",

+ 1 - 1
pioneer/packages/page-settings/src/useChainInfo.ts

@@ -25,7 +25,7 @@ export default function useChainInfo (): ChainInfo | null {
       metaCalls: Buffer.from(api.runtimeMetadata.asCallsOnly.toU8a()).toString('base64'),
       specVersion: api.runtimeVersion.specVersion.toNumber(),
       ss58Format: isNumber(api.registry.chainSS58) ? api.registry.chainSS58 : 42,
-      tokenDecimals: isNumber(api.registry.chainDecimals) ? api.registry.chainDecimals : 12,
+      tokenDecimals: isNumber(api.registry.chainDecimals[0]) ? api.registry.chainDecimals[0] : 12,
       tokenSymbol: api.registry.chainTokens[0] || 'Unit',
       types: getSpecTypes(registry, systemChain, api.runtimeVersion.specName, api.runtimeVersion.specVersion) as unknown as Record<string, string>
     });

+ 1 - 1
pioneer/packages/react-api/package.json

@@ -31,7 +31,7 @@
   "homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
   "dependencies": {
     "@babel/runtime": "^7.10.5",
-    "@polkadot/api": "^1.26.1",
+    "@polkadot/api": "4.2.1",
     "@polkadot/extension-dapp": "^0.32.0-beta.10",
     "rxjs-compat": "^6.6.0"
   }

+ 8 - 8
pioneer/packages/react-api/src/Api.tsx

@@ -2,6 +2,7 @@
 // This software may be modified and distributed under the terms
 // of the Apache-2.0 license. See the LICENSE file for details.
 
+import type BN from 'bn.js';
 import { InjectedExtension } from '@polkadot/extension-inject/types';
 import { ChainProperties, ChainType } from '@polkadot/types/interfaces';
 import { ApiProps, ApiState } from './types';
@@ -104,29 +105,28 @@ async function retrieve (api: ApiPromise): Promise<ChainData> {
 
 async function loadOnReady (api: ApiPromise, store: KeyringStore | undefined, types: Record<string, Record<string, string>>): Promise<ApiState> {
   registry.register(types);
-
   const { injectedAccounts, properties, systemChain, systemChainType, systemName, systemVersion } = await retrieve(api);
   const ss58Format = uiSettings.prefix === -1
     ? properties.ss58Format.unwrapOr(DEFAULT_SS58).toNumber()
     : uiSettings.prefix;
-  const tokenSymbol = properties.tokenSymbol.unwrap()[0].toString();
-  const tokenDecimals = properties.tokenDecimals.unwrap()[0].toNumber();
-  const isDevelopment = systemChainType.isDevelopment || systemChainType.isLocal || isTestChain(systemChain);
+  const tokenSymbol = properties.tokenSymbol.unwrap();
+  const tokenDecimals = properties.tokenDecimals.unwrap();
+  const isDevelopment = (systemChainType.isDevelopment || systemChainType.isLocal || isTestChain(systemChain));
 
   console.log(`chain: ${systemChain} (${systemChainType.toString()}), ${JSON.stringify(properties)}`);
 
   // explicitly override the ss58Format as specified
-  registry.setChainProperties(registry.createType('ChainProperties', { ...properties, ss58Format }));
+  registry.setChainProperties(registry.createType('ChainProperties', { ss58Format, tokenDecimals, tokenSymbol }));
 
   // FIXME This should be removed (however we have some hanging bits, e.g. vanity)
   setSS58Format(ss58Format);
 
   // first setup the UI helpers
   formatBalance.setDefaults({
-    decimals: tokenDecimals,
-    unit: tokenSymbol
+    decimals: (tokenDecimals as BN[]).map((b) => b.toNumber()),
+    unit: tokenSymbol[0].toString()
   });
-  TokenUnit.setAbbr(tokenSymbol);
+  TokenUnit.setAbbr(tokenSymbol[0].toString());
 
   // finally load the keyring
   keyring.loadAll({

+ 3 - 3
pioneer/packages/react-components/package.json

@@ -14,15 +14,15 @@
     "@fortawesome/fontawesome-svg-core": "^1.2.30",
     "@fortawesome/free-solid-svg-icons": "^5.14.0",
     "@fortawesome/react-fontawesome": "^0.1.11",
-    "@polkadot/keyring": "^3.0.1",
+    "@polkadot/keyring": "^6.0.5",
     "@polkadot/react-api": "0.51.1",
     "@polkadot/react-identicon": "^0.57.3",
     "@polkadot/react-qr": "^0.57.3",
     "@polkadot/react-query": "0.51.1",
     "@polkadot/ui-keyring": "^0.72.1",
     "@polkadot/ui-settings": "^0.72.1",
-    "@polkadot/util": "^3.0.1",
-    "@polkadot/util-crypto": "^3.0.1",
+    "@polkadot/util": "^6.0.5",
+    "@polkadot/util-crypto": "^6.0.5",
     "chart.js": "^2.9.3",
     "codeflask": "^1.4.1",
     "i18next": "^19.6.3",

+ 1 - 1
query-node/package.json

@@ -29,7 +29,7 @@
   },
   "dependencies": {
     "@dzlzv/hydra-indexer-lib": "^0.0.22-legacy.1.26.1",
-    "@joystream/types": "^0.14.0",
+    "@joystream/types": "^0.15.0",
     "@types/bn.js": "^4.11.6",
     "@types/debug": "^4.1.5",
     "bn.js": "^5.1.2",

+ 1 - 1
storage-node/packages/cli/package.json

@@ -47,7 +47,7 @@
     "@joystream/storage-runtime-api": "^0.1.0",
     "@joystream/service-discovery": "^0.1.0",
     "@joystream/storage-utils": "^0.1.0",
-    "@joystream/types": "^0.14.0",
+    "@joystream/types": "^0.15.0",
     "axios": "^0.19.2",
     "chalk": "^2.4.2",
     "lodash": "^4.17.11",

+ 2 - 2
storage-node/packages/runtime-api/package.json

@@ -46,8 +46,8 @@
   },
   "dependencies": {
     "@joystream/storage-utils": "^0.1.0",
-    "@joystream/types": "^0.14.0",
-    "@polkadot/api": "^1.26.1",
+    "@joystream/types": "^0.15.0",
+    "@polkadot/api": "4.2.1",
     "async-lock": "^1.2.0",
     "lodash": "^4.17.11",
     "password-prompt": "^1.1.2"

+ 3 - 3
tests/network-tests/package.json

@@ -13,8 +13,8 @@
   },
   "dependencies": {
     "@joystream/types": "link:../../types",
-    "@polkadot/api": "1.26.1",
-    "@polkadot/keyring": "3.0.1",
+    "@polkadot/api": "4.2.1",
+    "@polkadot/keyring": "^6.0.5",
     "@types/async-lock": "^1.1.2",
     "@types/bn.js": "^4.11.5",
     "@types/lowdb": "^1.0.9",
@@ -26,7 +26,7 @@
     "@apollo/client": "^3.2.5"
   },
   "devDependencies": {
-    "@polkadot/ts": "^0.3.14",
+    "@polkadot/ts": "^0.3.62",
     "@types/chai": "^4.2.11",
     "@types/uuid": "^7.0.2",
     "chai": "^4.2.0",

+ 5 - 5
types/package.json

@@ -1,7 +1,7 @@
 {
   "name": "@joystream/types",
-  "version": "0.14.0",
-  "description": "Types for Joystream Substrate Runtime - Babylon release",
+  "version": "0.15.0",
+  "description": "Types for Joystream Substrate Runtime - Antioch release",
   "main": "index.js",
   "types": "index.d.ts",
   "scripts": {
@@ -22,9 +22,9 @@
   "author": "Joystream contributors",
   "maintainers": [],
   "dependencies": {
-    "@polkadot/api": "2.4.1",
-    "@polkadot/keyring": "3.6.1",
-    "@polkadot/types": "2.4.1",
+    "@polkadot/api": "4.2.1",
+    "@polkadot/types": "4.2.1",
+    "@polkadot/keyring": "^6.0.5",
     "@types/lodash": "^4.14.157",
     "@types/vfile": "^4.0.0",
     "ajv": "^6.11.0",

+ 7 - 7
utils/api-scripts/package.json

@@ -9,17 +9,17 @@
     "tsnode-strict": "node -r ts-node/register --unhandled-rejections=strict"
   },
   "dependencies": {
-    "@joystream/types": "^0.14.0",
-    "@polkadot/api": "^1.26.1",
-    "@polkadot/types": "^1.26.1",
-    "@polkadot/keyring": "^3.0.1",
-    "@polkadot/util": "^3.0.1",
-    "@polkadot/util-crypto": "^3.0.1",
+    "@joystream/types": "^0.15.0",
+    "@polkadot/api": "4.2.1",
+    "@polkadot/types": "4.2.1",
+    "@polkadot/keyring": "^6.0.5",
+    "@polkadot/util": "^6.0.5",
+    "@polkadot/util-crypto": "^6.0.5",
     "@types/bn.js": "^4.11.5",
     "bn.js": "^4.11.8"
   },
   "devDependencies": {
-    "@polkadot/ts": "^0.1.56",
+    "@polkadot/ts": "^0.3.62",
     "typescript": "^3.9.7",
     "ts-node": "^8.6.2"
   },

+ 16 - 45
yarn.lock

@@ -2475,11 +2475,11 @@
     chalk "^4.0.0"
 
 "@joystream/types@link:types":
-  version "0.14.0"
+  version "0.15.0"
   dependencies:
-    "@polkadot/api" "2.4.1"
-    "@polkadot/keyring" "3.6.1"
-    "@polkadot/types" "2.4.1"
+    "@polkadot/api" "4.2.1"
+    "@polkadot/keyring" "^6.0.5"
+    "@polkadot/types" "4.2.1"
     "@types/lodash" "^4.14.157"
     "@types/vfile" "^4.0.0"
     ajv "^6.11.0"
@@ -3641,7 +3641,7 @@
     "@polkadot/x-rxjs" "^6.0.5"
     bn.js "^4.11.9"
 
-"@polkadot/api@1.26.1", "@polkadot/api@2.4.1", "@polkadot/api@4.2.1", "@polkadot/api@^1.26.1":
+"@polkadot/api@4.2.1", "@polkadot/api@^1.26.1":
   version "4.2.1"
   resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-4.2.1.tgz#8eb0997dc148a34a4aca3a0dcaabad9954565909"
   integrity sha512-PbXwcLnZr5V5LfKsovMS0TRG+rfJp8lJxluCyOSABDpaz2h1B5R8rdYEZCmXI3qSrT0yu2C6Pp8AjTQHRd7SAA==
@@ -3764,7 +3764,7 @@
     "@polkadot/util" "^6.0.5"
     "@zondax/ledger-polkadot" "^0.13.4"
 
-"@polkadot/keyring@3.0.1", "@polkadot/keyring@3.6.1", "@polkadot/keyring@^3.0.1", "@polkadot/keyring@^6.0.5":
+"@polkadot/keyring@^6.0.5":
   version "6.0.5"
   resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-6.0.5.tgz#b684f354476e96c657a7e8d3e5f0c090e1178b31"
   integrity sha512-v9Tmu+eGZnWpLzxHUj5AIvmfX0uCHWShtF90zvaLvMXLFRWfeuaFnZwdZ+fNkXsrbI0R/w1gRtpFqzsT7QUbVw==
@@ -3840,26 +3840,12 @@
     bn.js "^4.11.9"
     eventemitter3 "^4.0.7"
 
-"@polkadot/ts@^0.1.56":
-  version "0.1.91"
-  resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.91.tgz#e3cc05cea480cc3d15b213110aec082fb0af5e79"
-  integrity sha512-UB8zOFZXb/ih03izzAQ1r1DRpiUXBofxAlXjcx4530jopfiNsiU1LZ2J/uS3dVV1QXaGRhkgm8SIJDLsSMRYIQ==
-  dependencies:
-    "@types/chrome" "^0.0.92"
-
-"@polkadot/ts@^0.3.14":
-  version "0.3.23"
-  resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.3.23.tgz#2950c039c6a7e02962eb28026302d7ddd7fa830c"
-  integrity sha512-SOit6XLNOMrXuPKUyWpqwkd76pTS+0UVBWpTvL+4iLzOHWk0eKwfep+OVkKk1Mswy65GFJYecUWydIftfjnvIg==
-  dependencies:
-    "@types/chrome" "^0.0.114"
-
-"@polkadot/ts@^0.3.29":
-  version "0.3.34"
-  resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.3.34.tgz#6cb6026557efa82fa7d16d5861a59b2787974986"
-  integrity sha512-W3fNz67uzafPnxqtCIFu414wlIOQGfiuVJ4hta8ZPuJdUICphfhj6SEFjQVWXSHWghwjAZl48fF2ElbmoPFAgQ==
+"@polkadot/ts@^0.3.62":
+  version "0.3.62"
+  resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.3.62.tgz#a5876fba8f6b6a4d571ccc12ce1ba600a335f928"
+  integrity sha512-kE+cZXi1eCIbQSQc6T76FEXC0m3T5VabnmUZ14N3NjqFzRfiRAgMPdFONicfJ2/Gx78Cj1NRJWnGewNsYIXSNQ==
   dependencies:
-    "@types/chrome" "^0.0.122"
+    "@types/chrome" "^0.0.133"
 
 "@polkadot/typegen@4.2.1":
   version "4.2.1"
@@ -3889,7 +3875,7 @@
     "@polkadot/util" "^6.0.5"
     bn.js "^4.11.9"
 
-"@polkadot/types@2.4.1", "@polkadot/types@4.2.1", "@polkadot/types@^1.26.1":
+"@polkadot/types@4.2.1":
   version "4.2.1"
   resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-4.2.1.tgz#7be97d3abda4bb3f9031b43602062ed464596696"
   integrity sha512-xl8QnbXiJmSm6MUZH/U/ov3ZSXMN+KgNjsTCCzfz2xR5B3eK9ClYcstYYkNSyF12K90Gut9bnNSGZvaCfT2hNQ==
@@ -4861,29 +4847,14 @@
   dependencies:
     moment "^2.10.2"
 
-"@types/chrome@^0.0.114":
-  version "0.0.114"
-  resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.114.tgz#8ceb33fa261f4b9e307fa7344ba8182d8d410d4e"
-  integrity sha512-i7qRr74IrxHtbnrZSKUuP5Uvd5EOKwlwJq/yp7+yTPihOXnPhNQO4Z5bqb1XTnrjdbUKEJicaVVbhcgtRijmLA==
-  dependencies:
-    "@types/filesystem" "*"
-    "@types/har-format" "*"
-
-"@types/chrome@^0.0.122":
-  version "0.0.122"
-  resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.122.tgz#65265d3854f511c2c1e779148e97982ee00b460f"
-  integrity sha512-xHmT1AlBwKAVpQmv+/5gUsB1FXLUiizIZI6bIM52DJDtEhv97FkryHkohjw2HZqAGLOxuJ3kae7YfgWIZ+hMrg==
+"@types/chrome@^0.0.133":
+  version "0.0.133"
+  resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.133.tgz#9e1d55441584ba2d5274ca84db36427da9c5dc6e"
+  integrity sha512-G8uIUdaCTBILprQvQXBWGXZxjAWbkCkFQit17cdH3zYQEwU8f/etNl8+M7e8MRz9Xj8daHaVpysneMZMx8/ldQ==
   dependencies:
     "@types/filesystem" "*"
     "@types/har-format" "*"
 
-"@types/chrome@^0.0.92":
-  version "0.0.92"
-  resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.92.tgz#8630a52fcbcd0b30a2301f2a092386018ece1de6"
-  integrity sha512-bTv1EljZ03bexRJwS5FwSZmrudtw+QNbzwUY2sxVtXWgtxk752G4I2owhZ+Mlzbf3VKvG+rBYSw/FnvzuZ4xOA==
-  dependencies:
-    "@types/filesystem" "*"
-
 "@types/codeflask@^1.4.1":
   version "1.4.1"
   resolved "https://registry.yarnpkg.com/@types/codeflask/-/codeflask-1.4.1.tgz#05d6b919162b754e6014249ab02841a0db0fd60d"