From ec49c405995cc6b4e3d2a929dd335dbd38006472 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 28 Jun 2018 13:21:59 +0200 Subject: [PATCH] Format hash outputs (#107) --- packages/api-format/package.json | 8 +-- packages/api-format/src/output.ts | 2 + packages/api-provider/package.json | 8 +-- packages/api/package.json | 6 +- yarn.lock | 102 ++++++++++++++--------------- 5 files changed, 64 insertions(+), 62 deletions(-) diff --git a/packages/api-format/package.json b/packages/api-format/package.json index c724001ef9..c3d0ae674a 100644 --- a/packages/api-format/package.json +++ b/packages/api-format/package.json @@ -35,9 +35,9 @@ }, "dependencies": { "@babel/runtime": "^7.0.0-beta.51", - "@polkadot/jsonrpc": "^0.26.8", - "@polkadot/primitives": "^0.26.8", - "@polkadot/util": "^0.26.8", - "@polkadot/util-keyring": "^0.26.8" + "@polkadot/jsonrpc": "^0.26.9", + "@polkadot/primitives": "^0.26.9", + "@polkadot/util": "^0.26.9", + "@polkadot/util-keyring": "^0.26.9" } } diff --git a/packages/api-format/src/output.ts b/packages/api-format/src/output.ts index c22305cc5b..0559de4e53 100644 --- a/packages/api-format/src/output.ts +++ b/packages/api-format/src/output.ts @@ -8,6 +8,7 @@ import { FormatterFunction } from './types'; import addressEncode from '@polkadot/util-keyring/address/encode'; import bnDecode from '@polkadot/primitives/json/bn/decode'; import bytesDecode from '@polkadot/primitives/json/bytes/decode'; +import hashDecode from '@polkadot/primitives/json/hash/decode'; import headerDecode from '@polkadot/primitives/json/header/decode'; import isNull from '@polkadot/util/is/null'; import isUndefined from '@polkadot/util/is/undefined'; @@ -19,6 +20,7 @@ const formatters = new Map([ ['AccountId', addressEncode], ['BlockNumber', bnDecode], ['Bytes', bytesDecode], + ['Hash', hashDecode], ['Header', headerDecode], ['u64', bnDecode] ]); diff --git a/packages/api-provider/package.json b/packages/api-provider/package.json index b9936f20e1..c748adafc0 100644 --- a/packages/api-provider/package.json +++ b/packages/api-provider/package.json @@ -39,10 +39,10 @@ }, "dependencies": { "@babel/runtime": "^7.0.0-beta.51", - "@polkadot/storage": "^0.26.8", - "@polkadot/util": "^0.26.8", - "@polkadot/util-crypto": "^0.26.8", - "@polkadot/util-keyring": "^0.26.8", + "@polkadot/storage": "^0.26.9", + "@polkadot/util": "^0.26.9", + "@polkadot/util-crypto": "^0.26.9", + "@polkadot/util-keyring": "^0.26.9", "@types/nock": "^9.1.3", "eventemitter3": "^2.0.3", "isomorphic-fetch": "^2.2.1", diff --git a/packages/api/package.json b/packages/api/package.json index 093e883230..c71126c07c 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -37,8 +37,8 @@ "@babel/runtime": "^7.0.0-beta.51", "@polkadot/api-format": "^0.14.10", "@polkadot/api-provider": "^0.14.10", - "@polkadot/jsonrpc": "^0.26.8", - "@polkadot/params": "^0.26.8", - "@polkadot/util": "^0.26.8" + "@polkadot/jsonrpc": "^0.26.9", + "@polkadot/params": "^0.26.9", + "@polkadot/util": "^0.26.9" } } diff --git a/yarn.lock b/yarn.lock index b5d60237ad..6bb5acc335 100644 --- a/yarn.lock +++ b/yarn.lock @@ -736,94 +736,94 @@ tslint-config-semistandard "^7.0.0" typescript "^2.9.2" -"@polkadot/extrinsics@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.26.8.tgz#33073b6d1c53fdd6c47baaaa07b7bd16301df1ee" +"@polkadot/extrinsics@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.26.9.tgz#6a55b2629038f88cbc5126a69103ba3d785e1c02" dependencies: "@babel/runtime" "^7.0.0-beta.51" - "@polkadot/params" "^0.26.8" - "@polkadot/primitives" "^0.26.8" - "@polkadot/util" "^0.26.8" + "@polkadot/params" "^0.26.9" + "@polkadot/primitives" "^0.26.9" + "@polkadot/util" "^0.26.9" -"@polkadot/jsonrpc@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.26.8.tgz#c19c55d63436e9ce14909c096f16b4e442a8219e" +"@polkadot/jsonrpc@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.26.9.tgz#f21f8665f57fbaedd2d60dbe08eb478ba9c3797e" dependencies: - "@polkadot/params" "^0.26.8" + "@polkadot/params" "^0.26.9" babel-runtime "^6.26.0" -"@polkadot/params@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.26.8.tgz#aa1a3ba271042bcd954090be70e42b5b89951e43" +"@polkadot/params@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.26.9.tgz#cfaa1b1fb649003d7fd0308b2578c4f13ac8ec90" dependencies: "@babel/runtime" "^7.0.0-beta.51" - "@polkadot/extrinsics" "^0.26.8" - "@polkadot/primitives" "^0.26.8" - "@polkadot/util" "^0.26.8" + "@polkadot/extrinsics" "^0.26.9" + "@polkadot/primitives" "^0.26.9" + "@polkadot/util" "^0.26.9" -"@polkadot/primitives@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.26.8.tgz#7688e01110f7e03202a60b9d5dfdc29aefb5263b" +"@polkadot/primitives@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.26.9.tgz#1caef6a6b51ff944964a27200d56068fd985d14d" dependencies: "@babel/runtime" "^7.0.0-beta.51" - "@polkadot/trie-hash" "^0.26.8" - "@polkadot/util" "^0.26.8" + "@polkadot/trie-hash" "^0.26.9" + "@polkadot/util" "^0.26.9" -"@polkadot/storage@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.26.8.tgz#e5e785732e5fab911af18ee37215670f87f3692d" +"@polkadot/storage@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.26.9.tgz#5b7d60b74eb6a3bc73859f06547b3e7fe61cd6ba" dependencies: "@babel/runtime" "^7.0.0-beta.51" - "@polkadot/params" "^0.26.8" - "@polkadot/primitives" "^0.26.8" - "@polkadot/util" "^0.26.8" - "@polkadot/util-crypto" "^0.26.8" - "@polkadot/util-keyring" "^0.26.8" + "@polkadot/params" "^0.26.9" + "@polkadot/primitives" "^0.26.9" + "@polkadot/util" "^0.26.9" + "@polkadot/util-crypto" "^0.26.9" + "@polkadot/util-keyring" "^0.26.9" -"@polkadot/trie-hash@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/trie-hash/-/trie-hash-0.26.8.tgz#faf91d54c5e934dd86de8efdb803aa563519b0b5" +"@polkadot/trie-hash@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/trie-hash/-/trie-hash-0.26.9.tgz#9df4529b5bcf4694988f8168c6bb874c45040603" dependencies: "@babel/runtime" "^7.0.0-beta.51" - "@polkadot/util" "^0.26.8" - "@polkadot/util-crypto" "^0.26.8" - "@polkadot/util-rlp" "^0.26.8" + "@polkadot/util" "^0.26.9" + "@polkadot/util-crypto" "^0.26.9" + "@polkadot/util-rlp" "^0.26.9" "@polkadot/ts@^0.1.5": version "0.1.5" resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.5.tgz#bd944090a788d9379866059fb61b5708b4696cc7" -"@polkadot/util-crypto@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.26.8.tgz#f966ad8140e68cf7bf8324491135b5776e992360" +"@polkadot/util-crypto@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.26.9.tgz#86176ec7c0dcfa44056f64e42283f2e8f052f87a" dependencies: "@babel/runtime" "^7.0.0-beta.51" - "@polkadot/util" "^0.26.8" + "@polkadot/util" "^0.26.9" blakejs "^1.1.0" js-sha3 "^0.7.0" tweetnacl "^1.0.0" xxhashjs "^0.2.2" -"@polkadot/util-keyring@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/util-keyring/-/util-keyring-0.26.8.tgz#0a51712282ec175ac1d126369f631fcca65b8958" +"@polkadot/util-keyring@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/util-keyring/-/util-keyring-0.26.9.tgz#fd358feeebf2a15613d3a1de6efb61ee39231c45" dependencies: "@babel/runtime" "^7.0.0-beta.51" - "@polkadot/util" "^0.26.8" - "@polkadot/util-crypto" "^0.26.8" + "@polkadot/util" "^0.26.9" + "@polkadot/util-crypto" "^0.26.9" "@types/bs58" "^3.0.30" bs58 "^4.0.1" -"@polkadot/util-rlp@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/util-rlp/-/util-rlp-0.26.8.tgz#93abfd9599e87467bbd02591455fd44feea61faa" +"@polkadot/util-rlp@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/util-rlp/-/util-rlp-0.26.9.tgz#cee23ed6662903d8c59207c36bb7c3e7aed62d02" dependencies: "@babel/runtime" "^7.0.0-beta.51" - "@polkadot/util" "^0.26.8" + "@polkadot/util" "^0.26.9" -"@polkadot/util@^0.26.8": - version "0.26.8" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.26.8.tgz#110e4b3867e87eeb6c3159272b243d3074987e94" +"@polkadot/util@^0.26.9": + version "0.26.9" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.26.9.tgz#9a90aa66b2425d7350faa1c1764069f74eadd97a" dependencies: "@babel/runtime" "^7.0.0-beta.51" "@types/bn.js" "^4.11.1"