Compare commits

...
2 Commits
Author SHA1 Message Date
Github Actions 4fd74a04c8 [CI Skip] 1.6.2
skip-checks: true
2020-03-12 14:03:53 +00:00
Jaco Greeff 421594b0eb Fix .at check, disable (release 1.6.2) (#2034)
* Fix .at check, disable (release 1.6.2)

* Remove isAt (keep at revert only)

* Grrr....

* yarn installl (really need to add this to version bump script)
2020-03-12 14:53:25 +01:00
15 changed files with 114 additions and 102 deletions
+1
View File
@@ -1,2 +1,3 @@
20
1.4.2
1.6.2
+5 -1
View File
@@ -1,6 +1,10 @@
# 1.6.2 Feb 27, 2020
- Revert checks for arg, not working on `.at()` queries (proper fix in next version)
# 1.6.1 Mar 12, 2020
- **Breaking change** `api.rpc.state.queryStorage(...)` now full decodes the `Vec<StorageChangeSet>` and returns a decoded `[Hash, Codec[]][]` when using this RPC.
- **Breaking change** `api.rpc.state.queryStorage(...)` now fully decodes the `Vec<StorageChangeSet>` and returns a decoded `[Hash, Codec[]][]` when using this RPC.
- `StorageKey` now has an `.args` property, decoded from meta where `twox64_concat` or `blake128_concat` are used on maps
- Fix `api.query.*.*.entries` type conversions to return exact types (not `Option` in some cases)
- Add `api.query.*.*.keys` to retrieve only the storage keys, similar to `.entries`
+1 -1
View File
@@ -9,5 +9,5 @@
"packages": [
"packages/*"
],
"version": "1.6.1"
"version": "1.6.2"
}
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-contract",
"version": "1.6.1",
"version": "1.6.2",
"description": "Interfaces for interacting with contracts and contract ABIs",
"main": "index.js",
"keywords": [
@@ -27,9 +27,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"dependencies": {
"@babel/runtime": "^7.8.4",
"@polkadot/api": "1.6.1",
"@polkadot/rpc-core": "1.6.1",
"@polkadot/types": "1.6.1",
"@polkadot/api": "1.6.2",
"@polkadot/rpc-core": "1.6.2",
"@polkadot/types": "1.6.2",
"@polkadot/util": "^2.6.2",
"bn.js": "^5.1.1",
"rxjs": "^6.5.4"
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-derive",
"version": "1.6.1",
"version": "1.6.2",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"main": "index.js",
"keywords": [
@@ -28,10 +28,10 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": {
"@babel/runtime": "^7.8.4",
"@polkadot/api": "1.6.1",
"@polkadot/rpc-core": "1.6.1",
"@polkadot/rpc-provider": "1.6.1",
"@polkadot/types": "1.6.1",
"@polkadot/api": "1.6.2",
"@polkadot/rpc-core": "1.6.2",
"@polkadot/rpc-provider": "1.6.2",
"@polkadot/types": "1.6.2",
"@polkadot/util": "^2.6.2",
"@polkadot/util-crypto": "^2.6.2",
"bn.js": "^5.1.1",
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api",
"version": "1.6.1",
"version": "1.6.2",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"main": "index.js",
"keywords": [
@@ -27,12 +27,12 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"dependencies": {
"@babel/runtime": "^7.8.4",
"@polkadot/api-derive": "1.6.1",
"@polkadot/api-derive": "1.6.2",
"@polkadot/keyring": "^2.6.2",
"@polkadot/metadata": "1.6.1",
"@polkadot/rpc-core": "1.6.1",
"@polkadot/rpc-provider": "1.6.1",
"@polkadot/types": "1.6.1",
"@polkadot/metadata": "1.6.2",
"@polkadot/rpc-core": "1.6.2",
"@polkadot/rpc-provider": "1.6.2",
"@polkadot/types": "1.6.2",
"@polkadot/util": "^2.6.2",
"@polkadot/util-crypto": "^2.6.2",
"bn.js": "^5.1.1",
+1 -1
View File
@@ -11,7 +11,7 @@ import { TypeRegistry } from '@polkadot/types';
import { extractStorageArgs } from './validate';
describe('extractStorageArgs', (): void => {
describe.skip('extractStorageArgs', (): void => {
const registry = new TypeRegistry();
let storage: Storage;
+36 -29
View File
@@ -3,46 +3,53 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { StorageEntry } from '@polkadot/types/primitive/StorageKey';
import { Type } from '@polkadot/types';
import { assert } from '@polkadot/util';
function sig ({ method, section }: StorageEntry, ...args: Type[]): string {
return `${section}.${method}(${args.join(', ')})`;
}
// FIXME This breaks with .at(hash, ...)
function doDoubleMap (creator: StorageEntry, args: any[]): [StorageEntry, [any, any]] {
const { key1, key2 } = creator.meta.type.asDoubleMap;
// import { Type } from '@polkadot/types';
// import { assert } from '@polkadot/util';
assert(args.length === 2, `${sig(creator, key1, key2)} is a doublemap, requiring 2 arguments, ${args.length} found`);
// function sig ({ method, section }: StorageEntry, ...args: Type[]): string {
// return `${section}.${method}(${args.join(', ')})`;
// }
// pass as tuple
return [creator, args as [any, any]];
}
// function doDoubleMap (creator: StorageEntry, args: any[]): [StorageEntry, [any, any]] {
// const { key1, key2 } = creator.meta.type.asDoubleMap;
function doMap (creator: StorageEntry, args: any[]): [StorageEntry] | [StorageEntry, any] {
const { key, linked } = creator.meta.type.asMap;
// assert(args.length === 2, `${sig(creator, key1, key2)} is a doublemap, requiring 2 arguments, ${args.length} found`);
linked.isTrue
? assert(args.length <= 1, `${sig(creator, key)} is a linked map, requiring either 0 arguments (retrieving all) or 1 argument, ${args.length} found`)
: assert(args.length === 1, `${sig(creator, key)} is a map, requiring 1 argument, ${args.length} found`);
// // pass as tuple
// return [creator, args as [any, any]];
// }
// expand
return args.length
? [creator, args[0]]
: [creator];
}
// function doMap (creator: StorageEntry, args: any[]): [StorageEntry] | [StorageEntry, any] {
// const { key, linked } = creator.meta.type.asMap;
// linked.isTrue
// ? assert(args.length <= 1, `${sig(creator, key)} is a linked map, requiring either 0 arguments (retrieving all) or 1 argument, ${args.length} found`)
// : assert(args.length === 1, `${sig(creator, key)} is a map, requiring 1 argument, ${args.length} found`);
// // expand
// return args.length
// ? [creator, args[0]]
// : [creator];
// }
// sets up the arguments in the form of [creator, args] ready to be used in a storage
// call. Additionally, it verifies that the correct number of arguments have been passed
export function extractStorageArgs (creator: StorageEntry, args: any[]): any[] {
if (creator.meta.type.isDoubleMap) {
return doDoubleMap(creator, args);
} else if (creator.meta.type.isMap) {
return doMap(creator, args);
}
return creator.meta.type.isDoubleMap
? [creator, args]
: [creator, ...args];
assert(args.length === 0, `${sig(creator)} does not take any arguments, ${args.length} found`);
// if (creator.meta.type.isDoubleMap) {
// return doDoubleMap(creator, args);
// } else if (creator.meta.type.isMap) {
// return doMap(creator, args);
// }
// no args
return [creator];
// assert(args.length === 0, `${sig(creator)} does not take any arguments, ${args.length} found`);
// // no args
// return [creator, ...args];
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/jsonrpc",
"version": "1.6.1",
"version": "1.6.2",
"description": "Method definitions for the Polkadot RPC layer",
"main": "index.js",
"publishConfig": {
@@ -27,7 +27,7 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/jsonrpc#readme",
"dependencies": {
"@babel/runtime": "^7.8.4",
"@polkadot/types": "1.6.1",
"@polkadot/types": "1.6.2",
"@polkadot/util": "^2.6.2"
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/metadata",
"version": "1.6.1",
"version": "1.6.2",
"description": "Helpers to extract information from runtime metadata",
"main": "index.js",
"publishConfig": {
@@ -27,7 +27,7 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
"dependencies": {
"@babel/runtime": "^7.8.4",
"@polkadot/types": "1.6.1",
"@polkadot/types": "1.6.2",
"@polkadot/util": "^2.6.2",
"@polkadot/util-crypto": "^2.6.2",
"bn.js": "^5.1.1"
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-core",
"version": "1.6.1",
"version": "1.6.2",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
"keywords": [
@@ -27,10 +27,10 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"dependencies": {
"@babel/runtime": "^7.8.4",
"@polkadot/jsonrpc": "1.6.1",
"@polkadot/metadata": "1.6.1",
"@polkadot/rpc-provider": "1.6.1",
"@polkadot/types": "1.6.1",
"@polkadot/jsonrpc": "1.6.2",
"@polkadot/metadata": "1.6.2",
"@polkadot/rpc-provider": "1.6.2",
"@polkadot/types": "1.6.2",
"@polkadot/util": "^2.6.2",
"memoizee": "^0.4.14",
"rxjs": "^6.5.4"
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-provider",
"version": "1.6.1",
"version": "1.6.2",
"description": "Transport providers for the API",
"main": "index.js",
"keywords": [
@@ -27,9 +27,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.8.4",
"@polkadot/jsonrpc": "1.6.1",
"@polkadot/metadata": "1.6.1",
"@polkadot/types": "1.6.1",
"@polkadot/jsonrpc": "1.6.2",
"@polkadot/metadata": "1.6.2",
"@polkadot/types": "1.6.2",
"@polkadot/util": "^2.6.2",
"@polkadot/util-crypto": "^2.6.2",
"bn.js": "^5.1.1",
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/typegen",
"version": "1.6.1",
"version": "1.6.2",
"description": "Type generation scripts",
"main": "index.js",
"bin": {
@@ -36,11 +36,11 @@
"@babel/core": "^7.8.3",
"@babel/register": "^7.8.3",
"@babel/runtime": "^7.8.4",
"@polkadot/api": "1.6.1",
"@polkadot/jsonrpc": "1.6.1",
"@polkadot/metadata": "1.6.1",
"@polkadot/rpc-provider": "1.6.1",
"@polkadot/types": "1.6.1",
"@polkadot/api": "1.6.2",
"@polkadot/jsonrpc": "1.6.2",
"@polkadot/metadata": "1.6.2",
"@polkadot/rpc-provider": "1.6.2",
"@polkadot/types": "1.6.2",
"@polkadot/util": "^2.6.2",
"websocket": "^1.0.31",
"yargs": "^15.1.0"
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/types",
"version": "1.6.1",
"version": "1.6.2",
"description": "Implementation of the Parity codec",
"main": "index.js",
"keywords": [
@@ -27,7 +27,7 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.8.4",
"@polkadot/metadata": "1.6.1",
"@polkadot/metadata": "1.6.2",
"@polkadot/util": "^2.6.2",
"@polkadot/util-crypto": "^2.6.2",
"@types/bn.js": "^4.11.6",
+34 -34
View File
@@ -2842,25 +2842,25 @@ __metadata:
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
dependencies:
"@babel/runtime": ^7.8.4
"@polkadot/api": 1.6.1
"@polkadot/rpc-core": 1.6.1
"@polkadot/types": 1.6.1
"@polkadot/api": 1.6.2
"@polkadot/rpc-core": 1.6.2
"@polkadot/types": 1.6.2
"@polkadot/util": ^2.6.2
bn.js: ^5.1.1
rxjs: ^6.5.4
languageName: unknown
linkType: soft
"@polkadot/api-derive@1.6.1, @polkadot/api-derive@workspace:packages/api-derive":
"@polkadot/api-derive@1.6.2, @polkadot/api-derive@workspace:packages/api-derive":
version: 0.0.0-use.local
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
dependencies:
"@babel/runtime": ^7.8.4
"@polkadot/api": 1.6.1
"@polkadot/api": 1.6.2
"@polkadot/keyring": ^2.6.2
"@polkadot/rpc-core": 1.6.1
"@polkadot/rpc-provider": 1.6.1
"@polkadot/types": 1.6.1
"@polkadot/rpc-core": 1.6.2
"@polkadot/rpc-provider": 1.6.2
"@polkadot/types": 1.6.2
"@polkadot/util": ^2.6.2
"@polkadot/util-crypto": ^2.6.2
bn.js: ^5.1.1
@@ -2869,17 +2869,17 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/api@1.6.1, @polkadot/api@workspace:packages/api":
"@polkadot/api@1.6.2, @polkadot/api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@polkadot/api@workspace:packages/api"
dependencies:
"@babel/runtime": ^7.8.4
"@polkadot/api-derive": 1.6.1
"@polkadot/api-derive": 1.6.2
"@polkadot/keyring": ^2.6.2
"@polkadot/metadata": 1.6.1
"@polkadot/rpc-core": 1.6.1
"@polkadot/rpc-provider": 1.6.1
"@polkadot/types": 1.6.1
"@polkadot/metadata": 1.6.2
"@polkadot/rpc-core": 1.6.2
"@polkadot/rpc-provider": 1.6.2
"@polkadot/types": 1.6.2
"@polkadot/util": ^2.6.2
"@polkadot/util-crypto": ^2.6.2
bn.js: ^5.1.1
@@ -2976,12 +2976,12 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/jsonrpc@1.6.1, @polkadot/jsonrpc@workspace:packages/jsonrpc":
"@polkadot/jsonrpc@1.6.2, @polkadot/jsonrpc@workspace:packages/jsonrpc":
version: 0.0.0-use.local
resolution: "@polkadot/jsonrpc@workspace:packages/jsonrpc"
dependencies:
"@babel/runtime": ^7.8.4
"@polkadot/types": 1.6.1
"@polkadot/types": 1.6.2
"@polkadot/util": ^2.6.2
languageName: unknown
linkType: soft
@@ -2997,44 +2997,44 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/metadata@1.6.1, @polkadot/metadata@workspace:packages/metadata":
"@polkadot/metadata@1.6.2, @polkadot/metadata@workspace:packages/metadata":
version: 0.0.0-use.local
resolution: "@polkadot/metadata@workspace:packages/metadata"
dependencies:
"@babel/runtime": ^7.8.4
"@polkadot/keyring": ^2.6.2
"@polkadot/types": 1.6.1
"@polkadot/types": 1.6.2
"@polkadot/util": ^2.6.2
"@polkadot/util-crypto": ^2.6.2
bn.js: ^5.1.1
languageName: unknown
linkType: soft
"@polkadot/rpc-core@1.6.1, @polkadot/rpc-core@workspace:packages/rpc-core":
"@polkadot/rpc-core@1.6.2, @polkadot/rpc-core@workspace:packages/rpc-core":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
dependencies:
"@babel/runtime": ^7.8.4
"@polkadot/jsonrpc": 1.6.1
"@polkadot/jsonrpc": 1.6.2
"@polkadot/keyring": ^2.6.2
"@polkadot/metadata": 1.6.1
"@polkadot/rpc-provider": 1.6.1
"@polkadot/types": 1.6.1
"@polkadot/metadata": 1.6.2
"@polkadot/rpc-provider": 1.6.2
"@polkadot/types": 1.6.2
"@polkadot/util": ^2.6.2
memoizee: ^0.4.14
rxjs: ^6.5.4
languageName: unknown
linkType: soft
"@polkadot/rpc-provider@1.6.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
"@polkadot/rpc-provider@1.6.2, @polkadot/rpc-provider@workspace:packages/rpc-provider":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
dependencies:
"@babel/runtime": ^7.8.4
"@polkadot/jsonrpc": 1.6.1
"@polkadot/jsonrpc": 1.6.2
"@polkadot/keyring": ^2.6.2
"@polkadot/metadata": 1.6.1
"@polkadot/types": 1.6.1
"@polkadot/metadata": 1.6.2
"@polkadot/types": 1.6.2
"@polkadot/util": ^2.6.2
"@polkadot/util-crypto": ^2.6.2
bn.js: ^5.1.1
@@ -3062,11 +3062,11 @@ __metadata:
"@babel/core": ^7.8.3
"@babel/register": ^7.8.3
"@babel/runtime": ^7.8.4
"@polkadot/api": 1.6.1
"@polkadot/jsonrpc": 1.6.1
"@polkadot/metadata": 1.6.1
"@polkadot/rpc-provider": 1.6.1
"@polkadot/types": 1.6.1
"@polkadot/api": 1.6.2
"@polkadot/jsonrpc": 1.6.2
"@polkadot/metadata": 1.6.2
"@polkadot/rpc-provider": 1.6.2
"@polkadot/types": 1.6.2
"@polkadot/util": ^2.6.2
"@types/websocket": ^1.0.0
"@types/yargs": ^15.0.3
@@ -3081,13 +3081,13 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types@1.6.1, @polkadot/types@workspace:packages/types":
"@polkadot/types@1.6.2, @polkadot/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@polkadot/types@workspace:packages/types"
dependencies:
"@babel/runtime": ^7.8.4
"@polkadot/keyring": ^2.6.2
"@polkadot/metadata": 1.6.1
"@polkadot/metadata": 1.6.2
"@polkadot/util": ^2.6.2
"@polkadot/util-crypto": ^2.6.2
"@types/bn.js": ^4.11.6