From 45d89415bb845ea797709dabd7ca3628b46afd77 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 18 May 2018 10:46:22 +0200 Subject: [PATCH] Update @polkadot/jsonrpc (#92) * Drop api-jsonrpc in favour of @polkadot/jsonrpc * Change converters * Address issues after conversion * Update jsonrpc --- packages/api-format/package.json | 4 +- packages/api-format/src/format.js | 11 ++- packages/api-provider/package.json | 2 +- packages/api/package.json | 4 +- yarn.lock | 104 ++++++++++++++--------------- 5 files changed, 62 insertions(+), 63 deletions(-) diff --git a/packages/api-format/package.json b/packages/api-format/package.json index 8553913140..05caba6db0 100644 --- a/packages/api-format/package.json +++ b/packages/api-format/package.json @@ -31,8 +31,8 @@ }, "dependencies": { "@babel/runtime": "^7.0.0-beta.47", - "@polkadot/jsonrpc": "^0.15.2", - "@polkadot/primitives-json": "^0.15.2", + "@polkadot/jsonrpc": "^0.15.3", + "@polkadot/primitives-json": "^0.15.3", "@polkadot/util": "^0.21.1" } } diff --git a/packages/api-format/src/format.js b/packages/api-format/src/format.js index 9d610c019b..171b1e0cbe 100644 --- a/packages/api-format/src/format.js +++ b/packages/api-format/src/format.js @@ -3,11 +3,11 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { Param$Type, Param$Type$Tuple, Param$Types } from '@polkadot/params/types'; +import type { Param$Types, Param$Type$Array } from '@polkadot/params/types'; import type { FormatterFunction } from './types'; type FormattersFunctionMap = $Shape<{ - [Param$Type]: FormatterFunction + [Param$Types]: FormatterFunction }>; const typeToString = require('@polkadot/params/typeToString'); @@ -17,11 +17,11 @@ const l = require('@polkadot/util/logger')('api-format'); const echo = require('./echo'); // flowlint-next-line unclear-type:off -function formatSingleType (formatters: FormattersFunctionMap, type: Param$Type, value: any): any { +function formatSingleType (formatters: FormattersFunctionMap, type: Param$Types, value: any): any { const formatter: FormatterFunction = formatters[type]; if (isUndefined(formatter)) { - l.warn(`Unable to find default formatter for '${type}', falling back to echo`); + l.warn(`Unable to find default formatter for '${typeToString(type)}', falling back to echo`); return echo(value); } @@ -34,7 +34,7 @@ function formatSingleType (formatters: FormattersFunctionMap, type: Param$Type, } // flowlint-next-line unclear-type:off -function formatArrayType (formatters: FormattersFunctionMap, [ type ]: Param$Type$Tuple, value: Array): any { +function formatArrayType (formatters: FormattersFunctionMap, [ type ]: Param$Type$Array, value: Array): any { return value.map((value) => { return formatSingleType(formatters, type, value); }); @@ -47,7 +47,6 @@ module.exports = function format (formatters: FormattersFunctionMap, types: Arra if (Array.isArray(type)) { // FIXME we are currently not catering for tuples - // $FlowFixMe assume that we are only passing a single type through return formatArrayType(formatters, type, value); } diff --git a/packages/api-provider/package.json b/packages/api-provider/package.json index 61af0d00a6..63b0dba5a1 100644 --- a/packages/api-provider/package.json +++ b/packages/api-provider/package.json @@ -35,7 +35,7 @@ }, "dependencies": { "@babel/runtime": "^7.0.0-beta.47", - "@polkadot/storage-substrate": "^0.15.2", + "@polkadot/storage-substrate": "^0.15.3", "@polkadot/util": "^0.21.1", "@polkadot/util-crypto": "^0.21.1", "@polkadot/util-keyring": "^0.21.1", diff --git a/packages/api/package.json b/packages/api/package.json index 3e60a86a07..25a850704a 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -33,8 +33,8 @@ "@babel/runtime": "^7.0.0-beta.47", "@polkadot/api-format": "^0.12.1", "@polkadot/api-provider": "^0.12.1", - "@polkadot/jsonrpc": "^0.15.2", - "@polkadot/params": "^0.15.2", + "@polkadot/jsonrpc": "^0.15.3", + "@polkadot/params": "^0.15.3", "@polkadot/util": "^0.21.1" } } diff --git a/yarn.lock b/yarn.lock index c5fe6f9571..ce5558cf70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -700,102 +700,102 @@ mkdirp "^0.5.1" rimraf "^2.6.2" -"@polkadot/extrinsics-substrate@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/extrinsics-substrate/-/extrinsics-substrate-0.15.2.tgz#eceb2928c4682d21ec5288200f79c75a13b08772" +"@polkadot/extrinsics-substrate@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/extrinsics-substrate/-/extrinsics-substrate-0.15.3.tgz#2258f923b9c799be374375bbb57e70139baaf52f" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/extrinsics" "^0.15.2" + "@polkadot/extrinsics" "^0.15.3" -"@polkadot/extrinsics@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.15.2.tgz#4ac10e6f40059e90e5ee01a0bab3c520e7e69c57" +"@polkadot/extrinsics@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.15.3.tgz#4af6b339aa1dd59c1795562f2542dfdcf9265dc0" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/params" "^0.15.2" - "@polkadot/primitives" "^0.15.2" + "@polkadot/params" "^0.15.3" + "@polkadot/primitives" "^0.15.3" "@polkadot/util" "^0.21.1" -"@polkadot/jsonrpc@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.15.2.tgz#8237038b7af25e3212008276c92620928001ea5f" +"@polkadot/jsonrpc@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.15.3.tgz#94ad8c39fc9b01449c9e4adf0028a152f65c17d9" dependencies: - "@polkadot/params" "^0.15.2" + "@polkadot/params" "^0.15.3" babel-runtime "^6.26.0" -"@polkadot/params@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.15.2.tgz#f196ec68454b4856a2602f9cd53c00e695ccd7ff" +"@polkadot/params@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.15.3.tgz#1ce662b9823ac0a29366d5c0bd16f7064a694e02" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/extrinsics" "^0.15.2" - "@polkadot/extrinsics-substrate" "^0.15.2" - "@polkadot/primitives" "^0.15.2" + "@polkadot/extrinsics" "^0.15.3" + "@polkadot/extrinsics-substrate" "^0.15.3" + "@polkadot/primitives" "^0.15.3" "@polkadot/util" "^0.21.1" -"@polkadot/primitives-builder@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/primitives-builder/-/primitives-builder-0.15.2.tgz#b9d839a8fab631c598408af3a10c83be04f8b47f" +"@polkadot/primitives-builder@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/primitives-builder/-/primitives-builder-0.15.3.tgz#a3d1ff95920585c392e1103bea832ce7fb5d0249" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/primitives" "^0.15.2" - "@polkadot/primitives-codec" "^0.15.2" + "@polkadot/primitives" "^0.15.3" + "@polkadot/primitives-codec" "^0.15.3" "@polkadot/util" "^0.21.1" "@polkadot/util-crypto" "^0.21.1" "@polkadot/util-triehash" "^0.21.1" -"@polkadot/primitives-codec@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/primitives-codec/-/primitives-codec-0.15.2.tgz#41c7b5982be53995b56a5f11e56ab67e00f2ab99" +"@polkadot/primitives-codec@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/primitives-codec/-/primitives-codec-0.15.3.tgz#309eb1767423e36ea07d04481a60fb6e199811a5" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/primitives" "^0.15.2" - "@polkadot/primitives-builder" "^0.15.2" - "@polkadot/primitives-rlp" "^0.15.2" + "@polkadot/primitives" "^0.15.3" + "@polkadot/primitives-builder" "^0.15.3" + "@polkadot/primitives-rlp" "^0.15.3" "@polkadot/util" "^0.21.1" "@polkadot/util-keyring" "^0.21.1" -"@polkadot/primitives-json@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/primitives-json/-/primitives-json-0.15.2.tgz#242f417a0656d53edd8c3bb96769491bebb9f8dd" +"@polkadot/primitives-json@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/primitives-json/-/primitives-json-0.15.3.tgz#2d238269ea29f10ddbeee6f0edfc6fccd61bb56f" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/primitives" "^0.15.2" - "@polkadot/primitives-builder" "^0.15.2" + "@polkadot/primitives" "^0.15.3" + "@polkadot/primitives-builder" "^0.15.3" "@polkadot/util" "^0.21.1" -"@polkadot/primitives-rlp@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/primitives-rlp/-/primitives-rlp-0.15.2.tgz#461dcbadad3c1ed5931f4fe9805f01c1ef58cdc0" +"@polkadot/primitives-rlp@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/primitives-rlp/-/primitives-rlp-0.15.3.tgz#7377ca033ada2f43ecbca52ff9ac29fec124447d" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/primitives" "^0.15.2" - "@polkadot/primitives-builder" "^0.15.2" + "@polkadot/primitives" "^0.15.3" + "@polkadot/primitives-builder" "^0.15.3" "@polkadot/util" "^0.21.1" "@polkadot/util-crypto" "^0.21.1" -"@polkadot/primitives@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.15.2.tgz#60c97223286de22fdbda089718fb0dd98d0d96cc" +"@polkadot/primitives@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.15.3.tgz#8b7405db42bf45a88d40c92dcd830bf269bb4029" dependencies: "@babel/runtime" "^7.0.0-beta.47" "@polkadot/util" "^0.21.1" -"@polkadot/storage-substrate@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/storage-substrate/-/storage-substrate-0.15.2.tgz#a2966f51d1c939609832864a4bd73cd1f69db675" +"@polkadot/storage-substrate@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/storage-substrate/-/storage-substrate-0.15.3.tgz#950335d0b719ca9f5100ec1760a313d1461ac1b5" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/storage" "^0.15.2" + "@polkadot/storage" "^0.15.3" "@polkadot/util" "^0.21.1" -"@polkadot/storage@^0.15.2": - version "0.15.2" - resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.15.2.tgz#2ac60d398a3a61a515e9d62f92e5166c72c9666f" +"@polkadot/storage@^0.15.3": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.15.3.tgz#3c2981ef3085d8fbcb37877e82019101766bad68" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/params" "^0.15.2" - "@polkadot/primitives" "^0.15.2" + "@polkadot/params" "^0.15.3" + "@polkadot/primitives" "^0.15.3" "@polkadot/util" "^0.21.1" "@polkadot/util-crypto@^0.21.1":