From a6715a974e4c0a7467f6affff2e675c9e47674c9 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 17 Aug 2018 10:40:35 +0200 Subject: [PATCH] Fix encoding to allow both poc-1 & poc-2 blocks (#234) --- packages/app-democracy/package.json | 2 +- packages/app-example/package.json | 2 +- packages/app-explorer/package.json | 2 +- .../src/BlockByHash/BlockByHash.tsx | 6 +- .../app-explorer/src/BlockHeader/index.tsx | 29 +++--- packages/app-explorer/src/index.css | 1 + packages/app-extrinsics/package.json | 2 +- packages/app-staking/package.json | 2 +- packages/ui-app/package.json | 4 +- packages/ui-app/src/AddressMini.tsx | 2 +- packages/ui-app/src/styles/components.css | 4 + packages/ui-react-rx/package.json | 6 +- packages/ui-signer/package.json | 2 +- yarn.lock | 88 +++++++++---------- 14 files changed, 76 insertions(+), 76 deletions(-) diff --git a/packages/app-democracy/package.json b/packages/app-democracy/package.json index 7e2db8e706..fa6bf7c81c 100644 --- a/packages/app-democracy/package.json +++ b/packages/app-democracy/package.json @@ -11,7 +11,7 @@ "license": "ISC", "dependencies": { "@babel/runtime": "^7.0.0-rc.1", - "@polkadot/storage": "^0.28.17", + "@polkadot/storage": "^0.28.18", "@polkadot/ui-react": "^0.19.37", "@polkadot/ui-react-rx": "^0.19.37", "@polkadot/util-keyring": "^0.28.3" diff --git a/packages/app-example/package.json b/packages/app-example/package.json index 45236f543c..1b7c55b1f0 100644 --- a/packages/app-example/package.json +++ b/packages/app-example/package.json @@ -11,7 +11,7 @@ "license": "ISC", "dependencies": { "@babel/runtime": "^7.0.0-rc.1", - "@polkadot/storage": "^0.28.17", + "@polkadot/storage": "^0.28.18", "@polkadot/ui-react": "^0.19.37", "@polkadot/ui-react-rx": "^0.19.37", "@polkadot/util-keyring": "^0.28.3" diff --git a/packages/app-explorer/package.json b/packages/app-explorer/package.json index eb7db36101..9c04793c41 100644 --- a/packages/app-explorer/package.json +++ b/packages/app-explorer/package.json @@ -11,7 +11,7 @@ "license": "ISC", "dependencies": { "@babel/runtime": "^7.0.0-rc.1", - "@polkadot/primitives": "^0.28.17", + "@polkadot/primitives": "^0.28.18", "@polkadot/ui-app": "^0.19.37", "@polkadot/util-crypto": "^0.28.3" } diff --git a/packages/app-explorer/src/BlockByHash/BlockByHash.tsx b/packages/app-explorer/src/BlockByHash/BlockByHash.tsx index 0fac2de8cc..4dbc886fff 100644 --- a/packages/app-explorer/src/BlockByHash/BlockByHash.tsx +++ b/packages/app-explorer/src/BlockByHash/BlockByHash.tsx @@ -72,7 +72,7 @@ class BlockByHash extends React.PureComponent { defaultValue: 'extrinsics' })}
- {extrinsics.map((extrinsic: any, index: number) => ( + {extrinsics.map((extrinsic, index) => (
{ ? extrinsic.address : }
-
{t('block.nonce', { +
{t('block.accountIndex', { defaultValue: 'index' - })} {numberFormat(extrinsic.nonce)}
+ })} {numberFormat(extrinsic.accountIndex)}
diff --git a/packages/app-explorer/src/BlockHeader/index.tsx b/packages/app-explorer/src/BlockHeader/index.tsx index 570e3e4537..6f32eef591 100644 --- a/packages/app-explorer/src/BlockHeader/index.tsx +++ b/packages/app-explorer/src/BlockHeader/index.tsx @@ -39,9 +39,6 @@ class BlockHeader extends React.PureComponent { const { extrinsicsRoot, number, parentHash, stateRoot } = value; const hashHex = u8aToHex(hash); const parentHex = u8aToHex(parentHash); - const linkable = withLink - ? {hashHex} - : hashHex; return (
{
{numberFormat(number)}
-
- {linkable} -
+
{ + withLink + ? {hashHex} + : hashHex + }
- + - + - + {withExtrinsics ? diff --git a/packages/app-explorer/src/index.css b/packages/app-explorer/src/index.css index f1e3093789..e96da1c646 100644 --- a/packages/app-explorer/src/index.css +++ b/packages/app-explorer/src/index.css @@ -68,6 +68,7 @@ .explorer--BlockByHash-justification-signature span { color: rgba(0, 0, 0, 0.6); + font-family: monospace; font-style: italic; padding-left: 0.5rem; } diff --git a/packages/app-extrinsics/package.json b/packages/app-extrinsics/package.json index 7bfc72304d..d2ef760177 100644 --- a/packages/app-extrinsics/package.json +++ b/packages/app-extrinsics/package.json @@ -11,7 +11,7 @@ "license": "ISC", "dependencies": { "@babel/runtime": "^7.0.0-rc.1", - "@polkadot/extrinsics": "^0.28.17", + "@polkadot/extrinsics": "^0.28.18", "@polkadot/ui-app": "^0.19.37", "@polkadot/ui-signer": "^0.19.37", "react-dropzone": "^4.3.0" diff --git a/packages/app-staking/package.json b/packages/app-staking/package.json index a99a46d90e..01d45cfc33 100644 --- a/packages/app-staking/package.json +++ b/packages/app-staking/package.json @@ -12,7 +12,7 @@ "dependencies": { "@babel/runtime": "^7.0.0-rc.1", "@polkadot/app-extrinsics": "^0.19.37", - "@polkadot/storage": "^0.28.17", + "@polkadot/storage": "^0.28.18", "@polkadot/ui-app": "^0.19.37", "@polkadot/ui-keyring": "^0.19.37", "@polkadot/ui-react": "^0.19.37", diff --git a/packages/ui-app/package.json b/packages/ui-app/package.json index a4817dd83d..4caa453600 100644 --- a/packages/ui-app/package.json +++ b/packages/ui-app/package.json @@ -11,8 +11,8 @@ "license": "ISC", "dependencies": { "@babel/runtime": "^7.0.0-rc.1", - "@polkadot/extrinsics": "^0.28.17", - "@polkadot/storage": "^0.28.17", + "@polkadot/extrinsics": "^0.28.18", + "@polkadot/storage": "^0.28.18", "@polkadot/ui-keyring": "^0.19.37", "@polkadot/ui-react": "^0.19.37", "@polkadot/ui-react-rx": "^0.19.37", diff --git a/packages/ui-app/src/AddressMini.tsx b/packages/ui-app/src/AddressMini.tsx index 318e104f5f..39e83f3b4d 100644 --- a/packages/ui-app/src/AddressMini.tsx +++ b/packages/ui-app/src/AddressMini.tsx @@ -39,7 +39,7 @@ export default class AddressMini extends React.PureComponent { size={24} value={value} /> -
{isShort ? toShortAddress(value) : value}
+
{isShort ? toShortAddress(value) : value}
{children} {this.renderBalance()} diff --git a/packages/ui-app/src/styles/components.css b/packages/ui-app/src/styles/components.css index ddff4c4fd9..116b767d1a 100644 --- a/packages/ui-app/src/styles/components.css +++ b/packages/ui-app/src/styles/components.css @@ -46,6 +46,10 @@ vertical-align: middle; } +.ui--AddressMini-address { + font-family: monospace; +} + .ui--AddressMini .ui--IdentityIcon { margin-left: 1rem; margin-right: 0.5rem; diff --git a/packages/ui-react-rx/package.json b/packages/ui-react-rx/package.json index 4a87715766..90e93dcc97 100644 --- a/packages/ui-react-rx/package.json +++ b/packages/ui-react-rx/package.json @@ -31,9 +31,9 @@ "homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-react-rx#readme", "dependencies": { "@babel/runtime": "^7.0.0-rc.1", - "@polkadot/api-rx": "^0.28.17", - "@polkadot/extrinsics": "^0.28.17", - "@polkadot/storage": "^0.28.17", + "@polkadot/api-rx": "^0.28.18", + "@polkadot/extrinsics": "^0.28.18", + "@polkadot/storage": "^0.28.18", "rxjs-compat": "^6.2.2" }, "devDependencies": { diff --git a/packages/ui-signer/package.json b/packages/ui-signer/package.json index d33d200726..20d2aefaf3 100644 --- a/packages/ui-signer/package.json +++ b/packages/ui-signer/package.json @@ -11,7 +11,7 @@ "license": "ISC", "dependencies": { "@babel/runtime": "^7.0.0-rc.1", - "@polkadot/extrinsics": "^0.28.17", + "@polkadot/extrinsics": "^0.28.18", "@polkadot/ui-app": "^0.19.37", "@polkadot/ui-keyring": "^0.19.37" }, diff --git a/yarn.lock b/yarn.lock index 13b8f9d8bd..b681627b36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1291,22 +1291,22 @@ version "1.1.0" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.0.tgz#50c1e2260ac0ed9439a181de3725a0168d59c48a" -"@polkadot/api-format@^0.28.17": - version "0.28.17" - resolved "https://registry.yarnpkg.com/@polkadot/api-format/-/api-format-0.28.17.tgz#b7fe73bf6e984842a1c419e93b30745108138b84" +"@polkadot/api-format@^0.28.18": + version "0.28.18" + resolved "https://registry.yarnpkg.com/@polkadot/api-format/-/api-format-0.28.18.tgz#4b09cd99a359edae2afebefc0f941526efb73272" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/jsonrpc" "^0.28.17" - "@polkadot/primitives" "^0.28.17" + "@polkadot/jsonrpc" "^0.28.18" + "@polkadot/primitives" "^0.28.18" "@polkadot/util" "^0.28.3" "@polkadot/util-keyring" "^0.28.3" -"@polkadot/api-provider@^0.28.17": - version "0.28.17" - resolved "https://registry.yarnpkg.com/@polkadot/api-provider/-/api-provider-0.28.17.tgz#8b178db819588e6a49568d1904b4cf1de309415b" +"@polkadot/api-provider@^0.28.18": + version "0.28.18" + resolved "https://registry.yarnpkg.com/@polkadot/api-provider/-/api-provider-0.28.18.tgz#5f6cb7f410aac94dee22958dc75e00da001da6c1" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/storage" "^0.28.17" + "@polkadot/storage" "^0.28.18" "@polkadot/util" "^0.28.3" "@polkadot/util-crypto" "^0.28.3" "@polkadot/util-keyring" "^0.28.3" @@ -1315,25 +1315,25 @@ isomorphic-fetch "^2.2.1" websocket "^1.0.25" -"@polkadot/api-rx@^0.28.17": - version "0.28.17" - resolved "https://registry.yarnpkg.com/@polkadot/api-rx/-/api-rx-0.28.17.tgz#6a42cca37df8bda5fdf8268a1cc3134b24f22eee" +"@polkadot/api-rx@^0.28.18": + version "0.28.18" + resolved "https://registry.yarnpkg.com/@polkadot/api-rx/-/api-rx-0.28.18.tgz#2817714eec45e08ccd1a7bc247b14206723bfda3" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/api" "^0.28.17" - "@polkadot/api-provider" "^0.28.17" + "@polkadot/api" "^0.28.18" + "@polkadot/api-provider" "^0.28.18" "@types/rx" "^4.1.1" rxjs "^6.2.2" -"@polkadot/api@^0.28.17": - version "0.28.17" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.28.17.tgz#44184dfb62ab82463effac777968cbbbda0270f3" +"@polkadot/api@^0.28.18": + version "0.28.18" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.28.18.tgz#4d3f18d4b8d34acef2672994ade62bce7d08faa9" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/api-format" "^0.28.17" - "@polkadot/api-provider" "^0.28.17" - "@polkadot/jsonrpc" "^0.28.17" - "@polkadot/params" "^0.28.17" + "@polkadot/api-format" "^0.28.18" + "@polkadot/api-provider" "^0.28.18" + "@polkadot/jsonrpc" "^0.28.18" + "@polkadot/params" "^0.28.18" "@polkadot/util" "^0.28.3" "@polkadot/dev-react@^0.20.16": @@ -1401,48 +1401,48 @@ typedoc "^0.11.1" typescript "^3.0.1" -"@polkadot/extrinsics@^0.28.17": - version "0.28.17" - resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.28.17.tgz#d66777e6dbeb38dcad204aa29f2d75d0b6fa5682" +"@polkadot/extrinsics@^0.28.18": + version "0.28.18" + resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.28.18.tgz#80e682e5ddfb9c148f37d7f41a5814c7392db5a0" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/params" "^0.28.17" - "@polkadot/primitives" "^0.28.17" + "@polkadot/params" "^0.28.18" + "@polkadot/primitives" "^0.28.18" "@polkadot/util" "^0.28.3" -"@polkadot/jsonrpc@^0.28.17": - version "0.28.17" - resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.28.17.tgz#5f653e0de344c60ad6cac0a7f1420e900b265adc" +"@polkadot/jsonrpc@^0.28.18": + version "0.28.18" + resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.28.18.tgz#bbebad1cc5fe175b0b722d612fe0fd19b30e0c8e" dependencies: - "@polkadot/params" "^0.28.17" + "@polkadot/params" "^0.28.18" babel-runtime "^6.26.0" -"@polkadot/params@^0.28.17": - version "0.28.17" - resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.28.17.tgz#9eb493a8cff8961f977e1767edfb9a773fbc2221" +"@polkadot/params@^0.28.18": + version "0.28.18" + resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.28.18.tgz#e4f98c9066f1064182c887c499928f1347718cf1" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/extrinsics" "^0.28.17" - "@polkadot/params" "^0.28.17" - "@polkadot/primitives" "^0.28.17" + "@polkadot/extrinsics" "^0.28.18" + "@polkadot/params" "^0.28.18" + "@polkadot/primitives" "^0.28.18" "@polkadot/util" "^0.28.3" "@polkadot/util-keyring" "^0.28.3" -"@polkadot/primitives@^0.28.17": - version "0.28.17" - resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.28.17.tgz#4cd35c3a68990156dbb0490fa55c271aa44dfc79" +"@polkadot/primitives@^0.28.18": + version "0.28.18" + resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.28.18.tgz#8b75c87ce4a662874829c353c85008f6ae52fedc" dependencies: "@babel/runtime" "^7.0.0-rc.1" "@polkadot/trie-hash" "^0.28.3" "@polkadot/util" "^0.28.3" -"@polkadot/storage@^0.28.17": - version "0.28.17" - resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.28.17.tgz#3e00d7a22a0fdd8f117144c3dcaf115d6c4407f2" +"@polkadot/storage@^0.28.18": + version "0.28.18" + resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.28.18.tgz#d536a054c00cc4bce7235dbfddc51495fd482e9e" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/params" "^0.28.17" - "@polkadot/primitives" "^0.28.17" + "@polkadot/params" "^0.28.18" + "@polkadot/primitives" "^0.28.18" "@polkadot/util" "^0.28.3" "@polkadot/util-crypto" "^0.28.3" "@polkadot/util-keyring" "^0.28.3"
parentHash - - {parentHex} - - { + number.gtn(1) + ? {parentHex} + : parentHex + }
extrinsicsRoot - {u8aToHex(extrinsicsRoot)} - {u8aToHex(extrinsicsRoot)}
stateRoot - {u8aToHex(stateRoot)} - {u8aToHex(stateRoot)}