Add @polkadot/types-support (#3842)

* Add @polkadot/types-support

* jest config fix

* typegen lookups

* Build fixes

* Explicit kusama naming

* testMeta for v14 (local)

* CI test failure

* CI test failure v14

* Update with corrected data after test

* types-support json imports
This commit is contained in:
Jaco
2021-08-04 10:39:21 +02:00
committed by GitHub
parent 70ac38cfd2
commit f603100b8b
95 changed files with 1587 additions and 1138 deletions
+9
View File
@@ -1,5 +1,14 @@
# CHANGELOG # CHANGELOG
## master
Changes:
- Handle `BitSequence` in `PortableRegistry`
- Move all test-support static files into `@polkadot/types-support`
- Align static Metadata with latest Substrate
## 5.3.2 Aug 3, 2021 ## 5.3.2 Aug 3, 2021
Upgrade priority: Low. Recommended for users of bridges. Upgrade priority: Low. Recommended for users of bridges.
+3 -2
View File
@@ -12,7 +12,7 @@ module.exports = {
'@polkadot/metadata(.*)$': '<rootDir>/packages/metadata/src/$1', '@polkadot/metadata(.*)$': '<rootDir>/packages/metadata/src/$1',
'@polkadot/rpc-(core|provider)(.*)$': '<rootDir>/packages/rpc-$1/src/$2', '@polkadot/rpc-(core|provider)(.*)$': '<rootDir>/packages/rpc-$1/src/$2',
'@polkadot/typegen(.*)$': '<rootDir>/packages/typegen/src/$1', '@polkadot/typegen(.*)$': '<rootDir>/packages/typegen/src/$1',
'@polkadot/types-known(.*)$': '<rootDir>/packages/types-known/src/$1', '@polkadot/types-(known|support)(.*)$': '<rootDir>/packages/types-$1/src/$2',
// eslint-disable-next-line sort-keys // eslint-disable-next-line sort-keys
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1' '@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1'
}, },
@@ -25,7 +25,8 @@ module.exports = {
'<rootDir>/packages/rpc-provider/build', '<rootDir>/packages/rpc-provider/build',
'<rootDir>/packages/typegen/build', '<rootDir>/packages/typegen/build',
'<rootDir>/packages/types/build', '<rootDir>/packages/types/build',
'<rootDir>/packages/types-known/build' '<rootDir>/packages/types-known/build',
'<rootDir>/packages/types-support/build'
], ],
testTimeout: 30000, testTimeout: 30000,
transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)'] transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)']
+1 -1
View File
@@ -3,7 +3,7 @@
import { ApiPromise, WsProvider } from '@polkadot/api'; import { ApiPromise, WsProvider } from '@polkadot/api';
import { Metadata, TypeRegistry } from '@polkadot/types'; import { Metadata, TypeRegistry } from '@polkadot/types';
import metaStatic from '@polkadot/types/metadata/static-substrate'; import metaStatic from '@polkadot/types-support/metadata/static-substrate';
export function createApiWithAugmentations (): ApiPromise { export function createApiWithAugmentations (): ApiPromise {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
+1 -1
View File
@@ -4,7 +4,7 @@
import type { Storage } from '@polkadot/types/metadata/decorate/types'; import type { Storage } from '@polkadot/types/metadata/decorate/types';
import { decorateStorage, Metadata, TypeRegistry } from '@polkadot/types'; import { decorateStorage, Metadata, TypeRegistry } from '@polkadot/types';
import metaStatic from '@polkadot/types/metadata/static-substrate'; import metaStatic from '@polkadot/types-support/metadata/static-substrate';
import { extractStorageArgs } from './validate'; import { extractStorageArgs } from './validate';
+3 -3
View File
@@ -13,9 +13,9 @@ import EventEmitter from 'eventemitter3';
import { createTestKeyring } from '@polkadot/keyring/testing'; import { createTestKeyring } from '@polkadot/keyring/testing';
import { decorateStorage, Metadata } from '@polkadot/types'; import { decorateStorage, Metadata } from '@polkadot/types';
import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; import jsonrpc from '@polkadot/types/interfaces/jsonrpc';
import rpcHeader from '@polkadot/types/json/Header.004.json'; import rpcHeader from '@polkadot/types-support/json/Header.004.json';
import rpcSignedBlock from '@polkadot/types/json/SignedBlock.004.immortal.json'; import rpcSignedBlock from '@polkadot/types-support/json/SignedBlock.004.immortal.json';
import rpcMetadata from '@polkadot/types/metadata/static-substrate'; import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { assert, BN, bnToU8a, logger, u8aToHex } from '@polkadot/util'; import { assert, BN, bnToU8a, logger, u8aToHex } from '@polkadot/util';
import { randomAsU8a } from '@polkadot/util-crypto'; import { randomAsU8a } from '@polkadot/util-crypto';
+1
View File
@@ -32,6 +32,7 @@
"@polkadot/api": "5.3.3-0", "@polkadot/api": "5.3.3-0",
"@polkadot/rpc-provider": "5.3.3-0", "@polkadot/rpc-provider": "5.3.3-0",
"@polkadot/types": "5.3.3-0", "@polkadot/types": "5.3.3-0",
"@polkadot/types-support": "5.3.3-0",
"@polkadot/util": "^7.1.1", "@polkadot/util": "^7.1.1",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
"websocket": "^1.0.34", "websocket": "^1.0.34",
@@ -21,6 +21,7 @@ try {
'^@polkadot/rpc-core(.*)': './packages/rpc-core/src\\1', '^@polkadot/rpc-core(.*)': './packages/rpc-core/src\\1',
'^@polkadot/rpc-provider(.*)': './packages/rpc-provider/src\\1', '^@polkadot/rpc-provider(.*)': './packages/rpc-provider/src\\1',
'^@polkadot/types-known(.*)': './packages/types-known/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1',
'^@polkadot/types-support(.*)': './packages/types-support/src\\1',
'^@polkadot/types(.*)': './packages/types/src\\1' '^@polkadot/types(.*)': './packages/types/src\\1'
} }
}] }]
@@ -17,6 +17,7 @@ try {
['module-resolver', { ['module-resolver', {
alias: { alias: {
'^@polkadot/types-known(.*)': './packages/types-known/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1',
'^@polkadot/types-support(.*)': './packages/types-support/src\\1',
'^@polkadot/types(.*)': './packages/types/src\\1' '^@polkadot/types(.*)': './packages/types/src\\1'
} }
}] }]
@@ -18,6 +18,7 @@ try {
alias: { alias: {
'^@polkadot/typegen(.*)': './packages/typegen/src\\1', '^@polkadot/typegen(.*)': './packages/typegen/src\\1',
'^@polkadot/types-known(.*)': './packages/types-known/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1',
'^@polkadot/types-support(.*)': './packages/types-support/src\\1',
'^@polkadot/types(.*)': './packages/types/src\\1' '^@polkadot/types(.*)': './packages/types/src\\1'
} }
}] }]
@@ -17,6 +17,7 @@ try {
['module-resolver', { ['module-resolver', {
alias: { alias: {
'^@polkadot/types-known(.*)': './packages/types-known/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1',
'^@polkadot/types-support(.*)': './packages/types-support/src\\1',
'^@polkadot/types(.*)': './packages/types/src\\1' '^@polkadot/types(.*)': './packages/types/src\\1'
} }
}] }]
@@ -17,6 +17,7 @@ try {
['module-resolver', { ['module-resolver', {
alias: { alias: {
'^@polkadot/types-known(.*)': './packages/types-known/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1',
'^@polkadot/types-support(.*)': './packages/types-support/src\\1',
'^@polkadot/types(.*)': './packages/types/src\\1' '^@polkadot/types(.*)': './packages/types/src\\1'
} }
}] }]
+1 -1
View File
@@ -9,9 +9,9 @@ import fs from 'fs';
import { GenericCall as Call, Metadata, TypeRegistry, Vec } from '@polkadot/types'; import { GenericCall as Call, Metadata, TypeRegistry, Vec } from '@polkadot/types';
import * as definitions from '@polkadot/types/interfaces/definitions'; import * as definitions from '@polkadot/types/interfaces/definitions';
import { getStorage as getSubstrateStorage } from '@polkadot/types/metadata/decorate/storage/getStorage'; import { getStorage as getSubstrateStorage } from '@polkadot/types/metadata/decorate/storage/getStorage';
import rpcdata from '@polkadot/types/metadata/static-substrate';
import { Text } from '@polkadot/types/primitive'; import { Text } from '@polkadot/types/primitive';
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
import rpcdata from '@polkadot/types-support/metadata/static-substrate';
import { stringCamelCase, stringLowerFirst } from '@polkadot/util'; import { stringCamelCase, stringLowerFirst } from '@polkadot/util';
interface SectionItem { interface SectionItem {
+1 -1
View File
@@ -4,7 +4,7 @@
import type { ExtraTypes } from '../generate/types'; import type { ExtraTypes } from '../generate/types';
import { Metadata, TypeRegistry } from '@polkadot/types'; import { Metadata, TypeRegistry } from '@polkadot/types';
import staticData from '@polkadot/types/metadata/static-substrate'; import staticData from '@polkadot/types-support/metadata/static-substrate';
import { registerDefinitions } from './register'; import { registerDefinitions } from './register';
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "@polkadot/types-known", "name": "@polkadot/types-known",
"version": "5.3.3-0", "version": "5.3.3-0",
"type": "module", "type": "module",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "description": "Known type definitions",
"main": "index.js", "main": "index.js",
"sideEffects": [ "sideEffects": [
"./detectPackage.js", "./detectPackage.js",
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+3
View File
@@ -0,0 +1,3 @@
# @polkadot/types-known
Specific known base type overrides (e.g. `Address`, etc) for chains & specs. This does not contain user-specfic types.
+24
View File
@@ -0,0 +1,24 @@
{
"name": "@polkadot/types-support",
"version": "5.3.3-0",
"type": "module",
"description": "Supporting files for types, mostly for testing",
"main": "index.js",
"sideEffects": [
"./detectPackage.js",
"./detectPackage.cjs"
],
"engines": {
"node": ">=14.0.0"
},
"author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [],
"contributors": [],
"license": "Apache-2.0",
"repository": "github:polkadot-js/api",
"bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-support#readme",
"dependencies": {
"@babel/runtime": "^7.14.8"
}
}
@@ -0,0 +1,9 @@
// Copyright 2017-2021 @polkadot/types-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { packageInfo as typesInfo } from '@polkadot/types/packageInfo';
import { detectPackage } from '@polkadot/util';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [typesInfo]);
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2021 @polkadot/types-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './detectPackage';
File diff suppressed because one or more lines are too long
@@ -310,7 +310,7 @@
"name": "Authorities", "name": "Authorities",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 307 "plain": 308
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -321,7 +321,7 @@
"name": "GenesisSlot", "name": "GenesisSlot",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 128 "plain": 129
}, },
"fallback": "0x0000000000000000", "fallback": "0x0000000000000000",
"docs": [ "docs": [
@@ -333,7 +333,7 @@
"name": "CurrentSlot", "name": "CurrentSlot",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 128 "plain": 129
}, },
"fallback": "0x0000000000000000", "fallback": "0x0000000000000000",
"docs": [ "docs": [
@@ -364,7 +364,7 @@
"name": "PendingEpochConfigChange", "name": "PendingEpochConfigChange",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 130 "plain": 131
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -386,7 +386,7 @@
"name": "NextAuthorities", "name": "NextAuthorities",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 307 "plain": 308
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -419,7 +419,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 4, "key": 4,
"value": 309 "value": 310
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -431,7 +431,7 @@
"name": "Initialized", "name": "Initialized",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 310 "plain": 311
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -443,7 +443,7 @@
"name": "AuthorVrfRandomness", "name": "AuthorVrfRandomness",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 310 "plain": 311
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -487,7 +487,7 @@
"name": "EpochConfig", "name": "EpochConfig",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 311 "plain": 312
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -498,7 +498,7 @@
"name": "NextEpochConfig", "name": "NextEpochConfig",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 311 "plain": 312
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -537,7 +537,7 @@
} }
], ],
"errors": { "errors": {
"type": 312 "type": 313
}, },
"index": 2 "index": 2
}, },
@@ -571,7 +571,7 @@
] ]
}, },
"calls": { "calls": {
"type": 133 "type": 134
}, },
"events": null, "events": null,
"constants": [ "constants": [
@@ -599,7 +599,7 @@
"name": "Uncles", "name": "Uncles",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 313 "plain": 314
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -631,7 +631,7 @@
] ]
}, },
"calls": { "calls": {
"type": 135 "type": 136
}, },
"events": null, "events": null,
"constants": [ "constants": [
@@ -647,7 +647,7 @@
} }
], ],
"errors": { "errors": {
"type": 315 "type": 316
}, },
"index": 4 "index": 4
}, },
@@ -663,7 +663,7 @@
"map": { "map": {
"hasher": "Blake2_128Concat", "hasher": "Blake2_128Concat",
"key": 4, "key": 4,
"value": 316 "value": 317
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -674,7 +674,7 @@
] ]
}, },
"calls": { "calls": {
"type": 137 "type": 138
}, },
"events": { "events": {
"type": 29 "type": 29
@@ -690,7 +690,7 @@
} }
], ],
"errors": { "errors": {
"type": 317 "type": 318
}, },
"index": 5 "index": 5
}, },
@@ -734,7 +734,7 @@
"map": { "map": {
"hasher": "Blake2_128Concat", "hasher": "Blake2_128Concat",
"key": 0, "key": 0,
"value": 318 "value": 319
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -750,7 +750,7 @@
"map": { "map": {
"hasher": "Blake2_128Concat", "hasher": "Blake2_128Concat",
"key": 0, "key": 0,
"value": 322 "value": 323
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -762,7 +762,7 @@
"name": "StorageVersion", "name": "StorageVersion",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 325 "plain": 326
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -774,7 +774,7 @@
] ]
}, },
"calls": { "calls": {
"type": 138 "type": 139
}, },
"events": { "events": {
"type": 30 "type": 30
@@ -807,7 +807,7 @@
} }
], ],
"errors": { "errors": {
"type": 326 "type": 327
}, },
"index": 6 "index": 6
}, },
@@ -820,7 +820,7 @@
"name": "NextFeeMultiplier", "name": "NextFeeMultiplier",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 327 "plain": 328
}, },
"fallback": "0x000064a7b3b6e00d0000000000000000", "fallback": "0x000064a7b3b6e00d0000000000000000",
"docs": [] "docs": []
@@ -829,7 +829,7 @@
"name": "StorageVersion", "name": "StorageVersion",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 328 "plain": 329
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [] "docs": []
@@ -849,7 +849,7 @@
}, },
{ {
"name": "WeightToFee", "name": "WeightToFee",
"type": 329, "type": 330,
"value": "0x0401000000000000000000000000000000000000000001", "value": "0x0401000000000000000000000000000000000000000001",
"docs": [ "docs": [
" The polynomial that is applied in order to derive fee from weight." " The polynomial that is applied in order to derive fee from weight."
@@ -884,7 +884,7 @@
"name": "CurrentPhase", "name": "CurrentPhase",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 331 "plain": 332
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -895,7 +895,7 @@
"name": "QueuedSolution", "name": "QueuedSolution",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 333 "plain": 334
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -906,7 +906,7 @@
"name": "Snapshot", "name": "Snapshot",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 334 "plain": 335
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -932,7 +932,7 @@
"name": "SnapshotMetadata", "name": "SnapshotMetadata",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 195 "plain": 196
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -964,7 +964,7 @@
"name": "SignedSubmissionIndices", "name": "SignedSubmissionIndices",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 337 "plain": 338
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -983,7 +983,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 4, "key": 4,
"value": 341 "value": 342
} }
}, },
"fallback": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000", "fallback": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000",
@@ -1001,7 +1001,7 @@
"name": "MinimumUntrustedScore", "name": "MinimumUntrustedScore",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 194 "plain": 195
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -1014,7 +1014,7 @@
] ]
}, },
"calls": { "calls": {
"type": 141 "type": 142
}, },
"events": { "events": {
"type": 32 "type": 32
@@ -1153,7 +1153,7 @@
} }
], ],
"errors": { "errors": {
"type": 342 "type": 343
}, },
"index": 8 "index": 8
}, },
@@ -1258,7 +1258,7 @@
"map": { "map": {
"hasher": "Blake2_128Concat", "hasher": "Blake2_128Concat",
"key": 0, "key": 0,
"value": 343 "value": 344
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -1273,7 +1273,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 0, "key": 0,
"value": 201 "value": 202
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -1288,7 +1288,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 0, "key": 0,
"value": 202 "value": 203
} }
}, },
"fallback": "0x0000", "fallback": "0x0000",
@@ -1329,7 +1329,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 0, "key": 0,
"value": 346 "value": 347
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -1381,7 +1381,7 @@
"name": "ActiveEra", "name": "ActiveEra",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 347 "plain": 348
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -1466,7 +1466,7 @@
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key1": 4, "key1": 4,
"key2": 0, "key2": 0,
"value": 202, "value": 203,
"key2Hasher": "Twox64Concat" "key2Hasher": "Twox64Concat"
} }
}, },
@@ -1503,7 +1503,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 4, "key": 4,
"value": 348 "value": 349
} }
}, },
"fallback": "0x0000000000", "fallback": "0x0000000000",
@@ -1532,7 +1532,7 @@
"name": "ForceEra", "name": "ForceEra",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 352 "plain": 353
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -1571,7 +1571,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 4, "key": 4,
"value": 353 "value": 354
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -1601,7 +1601,7 @@
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key1": 4, "key1": 4,
"key2": 0, "key2": 0,
"value": 355, "value": 356,
"key2Hasher": "Twox64Concat" "key2Hasher": "Twox64Concat"
} }
}, },
@@ -1635,7 +1635,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 0, "key": 0,
"value": 356 "value": 357
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -1649,8 +1649,8 @@
"type": { "type": {
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 351, "key": 352,
"value": 357 "value": 358
} }
}, },
"fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -1687,7 +1687,7 @@
"name": "StorageVersion", "name": "StorageVersion",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 358 "plain": 359
}, },
"fallback": "0x06", "fallback": "0x06",
"docs": [ "docs": [
@@ -1701,7 +1701,7 @@
"name": "ChillThreshold", "name": "ChillThreshold",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 205 "plain": 206
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -1713,7 +1713,7 @@
] ]
}, },
"calls": { "calls": {
"type": 200 "type": 201
}, },
"events": { "events": {
"type": 36 "type": 36
@@ -1765,7 +1765,7 @@
} }
], ],
"errors": { "errors": {
"type": 359 "type": 360
}, },
"index": 9 "index": 9
}, },
@@ -1812,7 +1812,7 @@
"name": "QueuedKeys", "name": "QueuedKeys",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 360 "plain": 361
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -1840,7 +1840,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 0, "key": 0,
"value": 208 "value": 209
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -1854,7 +1854,7 @@
"type": { "type": {
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 362, "key": 363,
"value": 0 "value": 0
} }
}, },
@@ -1866,14 +1866,14 @@
] ]
}, },
"calls": { "calls": {
"type": 207 "type": 208
}, },
"events": { "events": {
"type": 37 "type": 37
}, },
"constants": [], "constants": [],
"errors": { "errors": {
"type": 364 "type": 365
}, },
"index": 10 "index": 10
}, },
@@ -1897,7 +1897,7 @@
"name": "PublicProps", "name": "PublicProps",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 365 "plain": 366
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -1911,7 +1911,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 4, "key": 4,
"value": 367 "value": 368
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -1928,7 +1928,7 @@
"map": { "map": {
"hasher": "Identity", "hasher": "Identity",
"key": 9, "key": 9,
"value": 368 "value": 369
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -1967,7 +1967,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 4, "key": 4,
"value": 369 "value": 370
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -1984,7 +1984,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 0, "key": 0,
"value": 372 "value": 373
} }
}, },
"fallback": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "fallback": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
@@ -2029,7 +2029,7 @@
"name": "NextExternal", "name": "NextExternal",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 377 "plain": 378
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -2046,7 +2046,7 @@
"map": { "map": {
"hasher": "Identity", "hasher": "Identity",
"key": 9, "key": 9,
"value": 378 "value": 379
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -2074,7 +2074,7 @@
"name": "StorageVersion", "name": "StorageVersion",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 379 "plain": 380
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -2086,7 +2086,7 @@
] ]
}, },
"calls": { "calls": {
"type": 210 "type": 211
}, },
"events": { "events": {
"type": 38 "type": 38
@@ -2183,7 +2183,7 @@
} }
], ],
"errors": { "errors": {
"type": 380 "type": 381
}, },
"index": 11 "index": 11
}, },
@@ -2196,7 +2196,7 @@
"name": "Proposals", "name": "Proposals",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 381 "plain": 382
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -2225,7 +2225,7 @@
"map": { "map": {
"hasher": "Identity", "hasher": "Identity",
"key": 9, "key": 9,
"value": 382 "value": 383
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -2269,14 +2269,14 @@
] ]
}, },
"calls": { "calls": {
"type": 214 "type": 215
}, },
"events": { "events": {
"type": 43 "type": 43
}, },
"constants": [], "constants": [],
"errors": { "errors": {
"type": 383 "type": 384
}, },
"index": 12 "index": 12
}, },
@@ -2289,7 +2289,7 @@
"name": "Proposals", "name": "Proposals",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 384 "plain": 385
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -2318,7 +2318,7 @@
"map": { "map": {
"hasher": "Identity", "hasher": "Identity",
"key": 9, "key": 9,
"value": 382 "value": 383
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -2362,14 +2362,14 @@
] ]
}, },
"calls": { "calls": {
"type": 216 "type": 217
}, },
"events": { "events": {
"type": 45 "type": 45
}, },
"constants": [], "constants": [],
"errors": { "errors": {
"type": 385 "type": 386
}, },
"index": 13 "index": 13
}, },
@@ -2382,7 +2382,7 @@
"name": "Members", "name": "Members",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 386 "plain": 387
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -2395,7 +2395,7 @@
"name": "RunnersUp", "name": "RunnersUp",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 386 "plain": 387
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -2439,7 +2439,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 0, "key": 0,
"value": 388 "value": 389
} }
}, },
"fallback": "0x000000000000000000000000000000000000000000000000000000000000000000", "fallback": "0x000000000000000000000000000000000000000000000000000000000000000000",
@@ -2452,7 +2452,7 @@
] ]
}, },
"calls": { "calls": {
"type": 217 "type": 218
}, },
"events": { "events": {
"type": 47 "type": 47
@@ -2521,7 +2521,7 @@
} }
], ],
"errors": { "errors": {
"type": 389 "type": 390
}, },
"index": 14 "index": 14
}, },
@@ -2555,14 +2555,14 @@
] ]
}, },
"calls": { "calls": {
"type": 219 "type": 220
}, },
"events": { "events": {
"type": 50 "type": 50
}, },
"constants": [], "constants": [],
"errors": { "errors": {
"type": 390 "type": 391
}, },
"index": 15 "index": 15
}, },
@@ -2575,7 +2575,7 @@
"name": "State", "name": "State",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 391 "plain": 392
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -2586,7 +2586,7 @@
"name": "PendingChange", "name": "PendingChange",
"modifier": "Optional", "modifier": "Optional",
"type": { "type": {
"plain": 392 "plain": 393
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -2648,14 +2648,14 @@
] ]
}, },
"calls": { "calls": {
"type": 220 "type": 221
}, },
"events": { "events": {
"type": 52 "type": 52
}, },
"constants": [], "constants": [],
"errors": { "errors": {
"type": 393 "type": 394
}, },
"index": 16 "index": 16
}, },
@@ -2682,7 +2682,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 4, "key": 4,
"value": 394 "value": 395
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -2694,7 +2694,7 @@
"name": "Approvals", "name": "Approvals",
"modifier": "Default", "modifier": "Default",
"type": { "type": {
"plain": 395 "plain": 396
}, },
"fallback": "0x00", "fallback": "0x00",
"docs": [ "docs": [
@@ -2704,7 +2704,7 @@
] ]
}, },
"calls": { "calls": {
"type": 232 "type": 233
}, },
"events": { "events": {
"type": 57 "type": 57
@@ -2712,7 +2712,7 @@
"constants": [ "constants": [
{ {
"name": "ProposalBond", "name": "ProposalBond",
"type": 396, "type": 397,
"value": "0x50c30000", "value": "0x50c30000",
"docs": [ "docs": [
" Fraction of a proposal's value that should be bonded in order to place the proposal.", " Fraction of a proposal's value that should be bonded in order to place the proposal.",
@@ -2737,7 +2737,7 @@
}, },
{ {
"name": "Burn", "name": "Burn",
"type": 396, "type": 397,
"value": "0x20a10700", "value": "0x20a10700",
"docs": [ "docs": [
" Percentage of spare funds (if any) that are burnt per spend period." " Percentage of spare funds (if any) that are burnt per spend period."
@@ -2745,7 +2745,7 @@
}, },
{ {
"name": "PalletId", "name": "PalletId",
"type": 397, "type": 398,
"value": "0x70792f7472737279", "value": "0x70792f7472737279",
"docs": [ "docs": [
" The treasury's pallet id, used for deriving its sovereign account ID." " The treasury's pallet id, used for deriving its sovereign account ID."
@@ -2761,7 +2761,7 @@
} }
], ],
"errors": { "errors": {
"type": 398 "type": 399
}, },
"index": 17 "index": 17
}, },
@@ -2792,7 +2792,7 @@
"map": { "map": {
"hasher": "Identity", "hasher": "Identity",
"key": 9, "key": 9,
"value": 399 "value": 400
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -2818,7 +2818,7 @@
"map": { "map": {
"hasher": "Twox64Concat", "hasher": "Twox64Concat",
"key": 0, "key": 0,
"value": 401 "value": 402
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -2845,7 +2845,7 @@
] ]
}, },
"calls": { "calls": {
"type": 233 "type": 234
}, },
"events": { "events": {
"type": 58 "type": 58
@@ -2978,7 +2978,7 @@
] ]
}, },
"calls": { "calls": {
"type": 234 "type": 235
}, },
"events": { "events": {
"type": 59 "type": 59
@@ -3065,7 +3065,7 @@
] ]
}, },
"calls": { "calls": {
"type": 235 "type": 236
}, },
"events": { "events": {
"type": 60 "type": 60
@@ -3228,7 +3228,7 @@
"map": { "map": {
"hasher": "Blake2_128Concat", "hasher": "Blake2_128Concat",
"key": 0, "key": 0,
"value": 279 "value": 280
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -3273,7 +3273,7 @@
] ]
}, },
"calls": { "calls": {
"type": 243 "type": 244
}, },
"events": { "events": {
"type": 71 "type": 71
@@ -3552,7 +3552,7 @@
] ]
}, },
"calls": { "calls": {
"type": 283 "type": 284
}, },
"events": { "events": {
"type": 72 "type": 72
@@ -3610,7 +3610,7 @@
}, },
{ {
"name": "PalletId", "name": "PalletId",
"type": 397, "type": 398,
"value": "0x70792f736f636965", "value": "0x70792f736f636965",
"docs": [ "docs": [
" The societies's module id" " The societies's module id"
@@ -3690,7 +3690,7 @@
] ]
}, },
"calls": { "calls": {
"type": 285 "type": 286
}, },
"events": { "events": {
"type": 74 "type": 74
@@ -3757,7 +3757,7 @@
"map": { "map": {
"hasher": "Blake2_128Concat", "hasher": "Blake2_128Concat",
"key": 0, "key": 0,
"value": 287 "value": 288
} }
}, },
"fallback": "0x00", "fallback": "0x00",
@@ -3768,7 +3768,7 @@
] ]
}, },
"calls": { "calls": {
"type": 286 "type": 287
}, },
"events": { "events": {
"type": 75 "type": 75
@@ -3839,7 +3839,7 @@
] ]
}, },
"calls": { "calls": {
"type": 288 "type": 289
}, },
"events": { "events": {
"type": 76 "type": 76
@@ -3908,7 +3908,7 @@
] ]
}, },
"calls": { "calls": {
"type": 290 "type": 291
}, },
"events": { "events": {
"type": 79 "type": 79
@@ -4018,7 +4018,7 @@
] ]
}, },
"calls": { "calls": {
"type": 292 "type": 293
}, },
"events": { "events": {
"type": 82 "type": 82
@@ -4121,7 +4121,7 @@
] ]
}, },
"calls": { "calls": {
"type": 294 "type": 295
}, },
"events": { "events": {
"type": 84 "type": 84
@@ -4161,7 +4161,7 @@
}, },
{ {
"name": "BountyCuratorDeposit", "name": "BountyCuratorDeposit",
"type": 396, "type": 397,
"value": "0x20a10700", "value": "0x20a10700",
"docs": [ "docs": [
" Percentage of the curator fee that will be reserved upfront as deposit for bounty curator." " Percentage of the curator fee that will be reserved upfront as deposit for bounty curator."
@@ -4230,7 +4230,7 @@
] ]
}, },
"calls": { "calls": {
"type": 295 "type": 296
}, },
"events": { "events": {
"type": 85 "type": 85
@@ -4246,7 +4246,7 @@
}, },
{ {
"name": "TipFindersFee", "name": "TipFindersFee",
"type": 205, "type": 206,
"value": "0x14", "value": "0x14",
"docs": [ "docs": [
" The amount of the final tip which goes to the original reporter of the tip." " The amount of the final tip which goes to the original reporter of the tip."
@@ -4358,7 +4358,7 @@
] ]
}, },
"calls": { "calls": {
"type": 296 "type": 297
}, },
"events": { "events": {
"type": 86 "type": 86
@@ -4548,7 +4548,7 @@
] ]
}, },
"calls": { "calls": {
"type": 298 "type": 299
}, },
"events": { "events": {
"type": 87 "type": 87
@@ -4556,7 +4556,7 @@
"constants": [ "constants": [
{ {
"name": "PalletId", "name": "PalletId",
"type": 397, "type": 398,
"value": "0x70792f6c6f74746f", "value": "0x70792f6c6f74746f",
"docs": [ "docs": [
" The Lottery's pallet id" " The Lottery's pallet id"
@@ -4650,7 +4650,7 @@
] ]
}, },
"calls": { "calls": {
"type": 299 "type": 300
}, },
"events": { "events": {
"type": 89 "type": 89
@@ -4853,7 +4853,7 @@
] ]
}, },
"calls": { "calls": {
"type": 302 "type": 303
}, },
"events": { "events": {
"type": 90 "type": 90
@@ -5044,7 +5044,7 @@
] ]
}, },
"calls": { "calls": {
"type": 305 "type": 306
}, },
"events": { "events": {
"type": 96 "type": 96
@@ -5062,37 +5062,37 @@
"signedExtensions": [ "signedExtensions": [
{ {
"identifier": "CheckSpecVersion", "identifier": "CheckSpecVersion",
"type": 494, "type": 498,
"additionalSigned": 4 "additionalSigned": 4
}, },
{ {
"identifier": "CheckTxVersion", "identifier": "CheckTxVersion",
"type": 495, "type": 499,
"additionalSigned": 4 "additionalSigned": 4
}, },
{ {
"identifier": "CheckGenesis", "identifier": "CheckGenesis",
"type": 496, "type": 500,
"additionalSigned": 9 "additionalSigned": 9
}, },
{ {
"identifier": "CheckMortality", "identifier": "CheckMortality",
"type": 497, "type": 501,
"additionalSigned": 9 "additionalSigned": 9
}, },
{ {
"identifier": "CheckNonce", "identifier": "CheckNonce",
"type": 499, "type": 503,
"additionalSigned": 42 "additionalSigned": 42
}, },
{ {
"identifier": "CheckWeight", "identifier": "CheckWeight",
"type": 500, "type": 504,
"additionalSigned": 42 "additionalSigned": 42
}, },
{ {
"identifier": "ChargeTransactionPayment", "identifier": "ChargeTransactionPayment",
"type": 501, "type": 505,
"additionalSigned": 42 "additionalSigned": 42
} }
] ]
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/types-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types-support', version: '5.3.3-0' };
+1
View File
@@ -26,6 +26,7 @@
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^7.1.1", "@polkadot/keyring": "^7.1.1",
"@polkadot/types-support": "5.3.3-0",
"@types/bn.js": "^4.11.6", "@types/bn.js": "^4.11.6",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
} }
+2 -1
View File
@@ -5,9 +5,10 @@ import type { VoteThreshold } from '../interfaces/elections';
import type { BlockNumber } from '../interfaces/runtime'; import type { BlockNumber } from '../interfaces/runtime';
import type { CodecTo } from '../types'; import type { CodecTo } from '../types';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../create'; import { TypeRegistry } from '../create';
import { Metadata } from '../metadata'; import { Metadata } from '../metadata';
import rpcMetadata from '../metadata/static-substrate';
import { Text, U32, u128 as U128 } from '../primitive'; import { Text, U32, u128 as U128 } from '../primitive';
import { Tuple } from '.'; import { Tuple } from '.';
+1 -1
View File
@@ -4,12 +4,12 @@
import type { PropIndex } from '../interfaces/democracy'; import type { PropIndex } from '../interfaces/democracy';
import type { Codec, CodecTo } from '../types'; import type { Codec, CodecTo } from '../types';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { randomAsU8a } from '@polkadot/util-crypto'; import { randomAsU8a } from '@polkadot/util-crypto';
import { createTypeUnsafe, TypeRegistry } from '../create'; import { createTypeUnsafe, TypeRegistry } from '../create';
import { GenericAccountId as AccountId } from '../generic'; import { GenericAccountId as AccountId } from '../generic';
import { Metadata } from '../metadata'; import { Metadata } from '../metadata';
import rpcMetadata from '../metadata/static-substrate';
import { Text } from '../primitive'; import { Text } from '../primitive';
import { Tuple, Vec } from '.'; import { Tuple, Vec } from '.';
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../create'; import { TypeRegistry } from '../create';
import { Metadata } from '../metadata'; import { Metadata } from '../metadata';
import rpcMetadata from '../metadata/static-substrate';
import { GenericExtrinsic as Extrinsic } from '.'; import { GenericExtrinsic as Extrinsic } from '.';
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../create'; import { TypeRegistry } from '../create';
import { Metadata } from '../metadata'; import { Metadata } from '../metadata';
import rpcMetadata from '../metadata/static-substrate';
import { GenericSignerPayload as SignerPayload } from '.'; import { GenericSignerPayload as SignerPayload } from '.';
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { createTestPairs } from '@polkadot/keyring/testingPairs'; import { createTestPairs } from '@polkadot/keyring/testingPairs';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { BN } from '@polkadot/util'; import { BN } from '@polkadot/util';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import { decorateExtrinsics, Metadata } from '../../metadata'; import { decorateExtrinsics, Metadata } from '../../metadata';
import rpcMetadata from '../../metadata/static-substrate';
import { GenericExtrinsicV4 as Extrinsic } from '.'; import { GenericExtrinsicV4 as Extrinsic } from '.';
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { createTestPairs } from '@polkadot/keyring/testingPairs'; import { createTestPairs } from '@polkadot/keyring/testingPairs';
import metadataStatic from '@polkadot/types-support/metadata/static-substrate';
import { BN_ZERO } from '@polkadot/util'; import { BN_ZERO } from '@polkadot/util';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import { Metadata } from '../../metadata'; import { Metadata } from '../../metadata';
import metadataStatic from '../../metadata/static-substrate';
import { GenericExtrinsicSignatureV4 as ExtrinsicSignature } from '.'; import { GenericExtrinsicSignatureV4 as ExtrinsicSignature } from '.';
const signOptions = { const signOptions = {
+2 -1
View File
@@ -3,9 +3,10 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
import jsonVec from '@polkadot/types-support/json/AccountIdVec.001.json';
import { Raw } from '../codec/Raw'; import { Raw } from '../codec/Raw';
import { TypeRegistry } from '../create'; import { TypeRegistry } from '../create';
import jsonVec from '../json/AccountIdVec.001.json';
import { GenericAccountId as AccountId } from '.'; import { GenericAccountId as AccountId } from '.';
describe('AccountId', (): void => { describe('AccountId', (): void => {
+3 -2
View File
@@ -4,10 +4,11 @@
/* eslint-disable sort-keys */ /* eslint-disable sort-keys */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
import block00300 from '@polkadot/types-support/json/SignedBlock.003.00.json';
import metadataStatic from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../create'; import { TypeRegistry } from '../create';
import block00300 from '../json/SignedBlock.003.00.json';
import { Metadata } from '../metadata'; import { Metadata } from '../metadata';
import metadataStatic from '../metadata/static-substrate';
import { GenericBlock as Block } from './Block'; import { GenericBlock as Block } from './Block';
const registry = new TypeRegistry(); const registry = new TypeRegistry();
+2 -1
View File
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import metadataStatic from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../create'; import { TypeRegistry } from '../create';
import { Metadata } from '../metadata'; import { Metadata } from '../metadata';
import metadataStatic from '../metadata/static-substrate';
import { GenericCall as Call } from '.'; import { GenericCall as Call } from '.';
const registry = new TypeRegistry(); const registry = new TypeRegistry();
+2 -1
View File
@@ -3,8 +3,9 @@
import type { Codec } from './types'; import type { Codec } from './types';
import metadataStatic from '@polkadot/types-support/metadata/static-substrate';
import * as definitions from './interfaces/definitions'; import * as definitions from './interfaces/definitions';
import metadataStatic from './metadata/static-substrate';
import { createTypeUnsafe, TypeRegistry } from './create'; import { createTypeUnsafe, TypeRegistry } from './create';
import * as exported from './index.types'; import * as exported from './index.types';
import { Metadata } from './metadata'; import { Metadata } from './metadata';
@@ -5,8 +5,9 @@
import type { ExtrinsicStatus } from './types'; import type { ExtrinsicStatus } from './types';
import rpc from '@polkadot/types-support/json/ExtrinsicStatus.001.json';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import rpc from '../../json/ExtrinsicStatus.001.json';
describe('ExtrinsicStatus', (): void => { describe('ExtrinsicStatus', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -3,8 +3,9 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
import json3 from '@polkadot/types-support/json/GrandpaRoundstate.001.json';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import json3 from '../../json/GrandpaRoundstate.001.json';
describe('ReportedRoundStates', (): void => { describe('ReportedRoundStates', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -3,8 +3,9 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
import json3 from '@polkadot/types-support/json/Header.003.json';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import json3 from '../../json/Header.003.json';
describe('Digest', (): void => { describe('Digest', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -3,14 +3,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
import json1 from '@polkadot/types-support/json/Header.001.json';
import json2 from '@polkadot/types-support/json/Header.002.json';
import json3 from '@polkadot/types-support/json/Header.003.json';
import block00300 from '@polkadot/types-support/json/SignedBlock.003.00.json';
import block00301 from '@polkadot/types-support/json/SignedBlock.003.01.json';
import { BN } from '@polkadot/util'; import { BN } from '@polkadot/util';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import json1 from '../../json/Header.001.json';
import json2 from '../../json/Header.002.json';
import json3 from '../../json/Header.003.json';
import block00300 from '../../json/SignedBlock.003.00.json';
import block00301 from '../../json/SignedBlock.003.01.json';
describe('Header', (): void => { describe('Header', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -5,8 +5,9 @@
import type { RuntimeVersion } from './types'; import type { RuntimeVersion } from './types';
import rpc from '@polkadot/types-support/json/RuntimeVersion.002.json';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import rpc from '../../json/RuntimeVersion.002.json';
describe('RuntimeVersion', (): void => { describe('RuntimeVersion', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -4,8 +4,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { TypeRegistry } from '@polkadot/types/create'; import { TypeRegistry } from '@polkadot/types/create';
import json from '@polkadot/types-support/json/StorageChangeSet.001.json';
import json from '../../json/StorageChangeSet.001.json';
describe('StorageChangeSet', (): void => { describe('StorageChangeSet', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -4,11 +4,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
import json1 from '@polkadot/types-support/json/EventRecord.001.json';
import json3 from '@polkadot/types-support/json/EventRecord.003.json';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import json1 from '../../json/EventRecord.001.json';
import json3 from '../../json/EventRecord.003.json';
import { Metadata } from '../../metadata'; import { Metadata } from '../../metadata';
import rpcMetadata from '../../metadata/static-substrate';
describe('EventRecord', (): void => { describe('EventRecord', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
+2 -1
View File
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import substrateData from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../create'; import { TypeRegistry } from '../create';
import { Metadata } from './Metadata'; import { Metadata } from './Metadata';
import substrateData from './static-substrate';
describe('Metadata', (): void => { describe('Metadata', (): void => {
it('allows creation from hex with JSON equivalence', (): void => { it('allows creation from hex with JSON equivalence', (): void => {
+5 -7
View File
@@ -2,12 +2,10 @@
1. New branch :) 1. New branch :)
2. `curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "state_getMetadata", "params":[]}' http://localhost:9933` 2. `curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "state_getMetadata", "params":[]}' http://localhost:9933`
3. Copy the latest version folder (vx) in `types/Metadata` 3. Copy the latest version folder (vx) in `types-support/metadata`
3. Copy the result (hex-only) into `static.ts`, as of now linked to `v6/static.ts` 3. Copy the result (hex-only) into `static.ts`, as of now linked to `v6/static.ts`
4. Rust Metadata tests, `yarn run test packages/types/src/Metadata` 4. Rust Metadata tests, `yarn run test packages/types/src/metadata`
5. Add new class types as required (find missing in Rust code, add) 5. Add new class types as required (find missing in Rust code, add)
6. Add all classes to `src/classes.ts` 6. Repeat 4-6 until passing
7. Repeat 4-6 until passing 7. All tests
8. Update parsed JSON to actual output version, `v6/latest.*.json` 8. Make PR
9. All tests
10. Make PR
@@ -4,10 +4,11 @@
import type { BlockNumber } from '../../../interfaces'; import type { BlockNumber } from '../../../interfaces';
import type { Constants } from '../types'; import type { Constants } from '../types';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import rpcMetadataV10 from '@polkadot/types-support/metadata/v10/substrate-hex';
import { TypeRegistry } from '../../../create'; import { TypeRegistry } from '../../../create';
import { Metadata } from '../../Metadata'; import { Metadata } from '../../Metadata';
import rpcMetadata from '../../static-substrate';
import rpcMetadataV10 from '../../v10/substrate-hex';
import { decorateConstants } from '..'; import { decorateConstants } from '..';
function init (meta: string): [Constants, TypeRegistry] { function init (meta: string): [Constants, TypeRegistry] {
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { createTestPairs } from '@polkadot/keyring/testingPairs'; import { createTestPairs } from '@polkadot/keyring/testingPairs';
import metadataStatic from '@polkadot/types-support/metadata/static-substrate';
import { BN } from '@polkadot/util'; import { BN } from '@polkadot/util';
import { TypeRegistry } from '../../../create'; import { TypeRegistry } from '../../../create';
import { Metadata } from '../../Metadata'; import { Metadata } from '../../Metadata';
import metadataStatic from '../../static-substrate';
import { decorateExtrinsics } from '..'; import { decorateExtrinsics } from '..';
const keyring = createTestPairs({ type: 'ed25519' }, false); const keyring = createTestPairs({ type: 'ed25519' }, false);
@@ -1,11 +1,11 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import json from '@polkadot/types-support/metadata/static-substrate';
import { u8aToHex } from '@polkadot/util'; import { u8aToHex } from '@polkadot/util';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import { Metadata } from '../Metadata'; import { Metadata } from '../Metadata';
import json from '../static-substrate';
import { decorateConstants, decorateExtrinsics, decorateStorage } from './'; import { decorateConstants, decorateExtrinsics, decorateStorage } from './';
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { createTestPairs } from '@polkadot/keyring/testingPairs'; import { createTestPairs } from '@polkadot/keyring/testingPairs';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { u8aToHex } from '@polkadot/util'; import { u8aToHex } from '@polkadot/util';
import { TypeRegistry } from '../../../create'; import { TypeRegistry } from '../../../create';
import { Metadata } from '../../'; import { Metadata } from '../../';
import rpcMetadata from '../../static-substrate';
import { decorateStorage } from '..'; import { decorateStorage } from '..';
const keyring = createTestPairs({ type: 'ed25519' }); const keyring = createTestPairs({ type: 'ed25519' });
+18 -6
View File
@@ -5,6 +5,9 @@ import type { Codec, Registry } from '../../types';
import type { MetadataInterface } from '../types'; import type { MetadataInterface } from '../types';
import type { Check } from './types'; import type { Check } from './types';
import fs from 'fs';
import path from 'path';
import { assert, hexToU8a, stringify, u8aToHex } from '@polkadot/util'; import { assert, hexToU8a, stringify, u8aToHex } from '@polkadot/util';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
@@ -13,20 +16,29 @@ import { Metadata } from '../Metadata';
import { getUniqTypes } from './getUniqTypes'; import { getUniqTypes } from './getUniqTypes';
/** @internal */ /** @internal */
export function decodeLatestMeta<Modules extends Codec> (registry: Registry, version: number, { compare, data }: Check): void { export function decodeLatestMeta<Modules extends Codec> (registry: Registry, type: string, version: number, { compare, data }: Check): void {
it('decodes metadata properly', (): void => { it('decodes metadata properly', (): void => {
const metadata = new Metadata(registry, data); const metadata = new Metadata(registry, data);
registry.setMetadata(metadata); registry.setMetadata(metadata);
expect(metadata.version).toBe(version);
expect((metadata[`asV${version}` as keyof Metadata] as unknown as MetadataInterface<Modules>).modules.length).not.toBe(0);
try { try {
expect(metadata.version).toBe(version);
expect((metadata[`asV${version}` as keyof Metadata] as unknown as MetadataInterface<Modules>).modules.length).not.toBe(0);
expect(metadata.toJSON()).toEqual(compare); expect(metadata.toJSON()).toEqual(compare);
} catch (error) { } catch (error) {
console.error(stringify(metadata.toJSON())); if (process.env.GITHUB_REPOSITORY) {
console.error(stringify(metadata.toJSON()));
throw error; throw error;
}
fs.writeFileSync(
path.join(process.cwd(), `packages/types-support/src/metadata/v${version}/${type}-json.json`),
stringify(metadata.toJSON(), 2),
{ flag: 'w' }
);
} }
}); });
} }
@@ -91,7 +103,7 @@ export function testMeta (version: number, matchers: Record<string, Check>, with
const matcher = matchers[type]; const matcher = matchers[type];
const registry = new TypeRegistry(); const registry = new TypeRegistry();
decodeLatestMeta(registry, version, matcher); decodeLatestMeta(registry, type, version, matcher);
toLatest(registry, version, matcher.data); toLatest(registry, version, matcher.data);
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import staticData from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import { Metadata } from '../Metadata'; import { Metadata } from '../Metadata';
import staticData from '../static-substrate';
describe('toCallsOnly', (): void => { describe('toCallsOnly', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import substrateData from '@polkadot/types-support/metadata/v10/substrate-hex';
import substrateJson from '@polkadot/types-support/metadata/v10/substrate-json.json';
import { testMeta } from '../util/testUtil'; import { testMeta } from '../util/testUtil';
import substrateData from './substrate-hex';
import substrateJson from './substrate-json.json';
testMeta(10, { testMeta(10, {
substrate: { substrate: {
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import substrateData from '@polkadot/types-support/metadata/v11/substrate-hex';
import substrateJson from '@polkadot/types-support/metadata/v11/substrate-json.json';
import { testMeta } from '../util/testUtil'; import { testMeta } from '../util/testUtil';
import substrateData from './substrate-hex';
import substrateJson from './substrate-json.json';
testMeta(11, { testMeta(11, {
substrate: { substrate: {
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import substrateData from '@polkadot/types-support/metadata/v12/substrate-hex';
import substrateJson from '@polkadot/types-support/metadata/v12/substrate-json.json';
import { testMeta } from '../util/testUtil'; import { testMeta } from '../util/testUtil';
import substrateData from './substrate-hex';
import substrateJson from './substrate-json.json';
testMeta(12, { testMeta(12, {
substrate: { substrate: {
@@ -1,11 +1,12 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import polkadotData from '@polkadot/types-support/metadata/v13/polkadot-hex';
import polkadotJson from '@polkadot/types-support/metadata/v13/polkadot-json.json';
import substrateData from '@polkadot/types-support/metadata/v13/substrate-hex';
import substrateJson from '@polkadot/types-support/metadata/v13/substrate-json.json';
import { testMeta } from '../util/testUtil'; import { testMeta } from '../util/testUtil';
import polkadotData from './polkadot-hex';
import polkadotJson from './polkadot-json.json';
import substrateData from './substrate-hex';
import substrateJson from './substrate-json.json';
testMeta(13, { testMeta(13, {
polkadot: { polkadot: {
@@ -2,86 +2,90 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { MetadataAll } from '../../interfaces/metadata'; import type { MetadataAll } from '../../interfaces/metadata';
import type { Check } from '../util/types';
import fs from 'fs';
import path from 'path';
import kusamaData from '@polkadot/types-support/metadata/v14/kusama-hex';
import kusamaJson from '@polkadot/types-support/metadata/v14/kusama-json.json';
import kusamaTypes from '@polkadot/types-support/metadata/v14/kusama-types.json';
import substrateData from '@polkadot/types-support/metadata/v14/substrate-hex';
import substrateJson from '@polkadot/types-support/metadata/v14/substrate-json.json';
import substrateTypes from '@polkadot/types-support/metadata/v14/substrate-types.json';
import { stringify } from '@polkadot/util';
import { TypeRegistry } from '../../create'; import { TypeRegistry } from '../../create';
import { Metadata } from '../Metadata'; import { Metadata } from '../Metadata';
import polkadotData from './polkadot-hex';
import polkadotJson from './polkadot-json.json';
import polkadotTypes from './polkadot-types.json';
import substrateData from './substrate-hex';
import substrateJson from './substrate-json.json';
import substrateTypes from './substrate-types.json';
describe('MetadataV14 (substrate)', (): void => { function testMeta (version: number, matchers: Record<string, Check>): void {
// FIXME This is to be replaced with the proper version (here as a stop-gap) describe(`MetadataV${version}`, (): void => {
it('parses', (): void => { describe.each(Object.keys(matchers))('%s', (type): void => {
const registry = new TypeRegistry(); const { compare, data, types } = matchers[type];
const metadata = new Metadata(registry, substrateData);
const all = metadata.get('metadata') as MetadataAll;
const v14 = all.asV14;
const jsonStruct = v14.toJSON();
const jsonTypes = v14.lookup.types.toJSON();
delete (jsonStruct as Record<string, unknown>).lookup; // FIXME This is to be replaced with the proper version (here as a stop-gap)
it('parses', (): void => {
const registry = new TypeRegistry();
const metadata = new Metadata(registry, data);
const all = metadata.get('metadata') as MetadataAll;
const v14 = all.asV14;
const jsonStruct = v14.toJSON();
const jsonTypes = v14.lookup.types.toJSON();
const allJson = { delete (jsonStruct as Record<string, unknown>).lookup;
magicNumber: 1635018093,
metadata: {
v14: jsonStruct
}
};
try { const allJson = {
expect(allJson).toEqual(substrateJson); magicNumber: 1635018093,
} catch (error) { metadata: {
console.error(JSON.stringify(allJson)); v14: jsonStruct
}
};
throw error; try {
} expect(allJson).toEqual(compare);
} catch (error) {
if (process.env.GITHUB_REPOSITORY) {
console.error(stringify(allJson));
try { throw error;
expect(jsonTypes).toEqual(substrateTypes); }
} catch (error) {
console.error(JSON.stringify(jsonTypes));
throw error; fs.writeFileSync(
} path.join(process.cwd(), `packages/types-support/src/metadata/v${version}/${type}-json.json`),
}); stringify(allJson, 2),
}); { flag: 'w' }
);
describe('MetadataV14 (polkadot)', (): void => { }
// FIXME This is to be replaced with the proper version (here as a stop-gap)
it('parses', (): void => { try {
const registry = new TypeRegistry(); expect(jsonTypes).toEqual(types);
const metadata = new Metadata(registry, polkadotData); } catch (error) {
const all = metadata.get('metadata') as MetadataAll; if (process.env.GITHUB_REPOSITORY) {
const v14 = all.asV14; console.error(stringify(jsonTypes));
const jsonStruct = v14.toJSON();
const jsonTypes = v14.lookup.types.toJSON(); throw error;
}
delete (jsonStruct as Record<string, unknown>).lookup;
fs.writeFileSync(
const allJson = { path.join(process.cwd(), `packages/types-support/src/metadata/v${version}/${type}-types.json`),
magicNumber: 1635018093, stringify(jsonTypes, 2),
metadata: { { flag: 'w' }
v14: jsonStruct );
} }
}; });
});
try {
expect(allJson).toEqual(polkadotJson);
} catch (error) {
console.error(JSON.stringify(allJson));
throw error;
}
try {
expect(jsonTypes).toEqual(polkadotTypes);
} catch (error) {
console.error(JSON.stringify(jsonTypes));
throw error;
}
}); });
}
testMeta(14, {
kusama: {
compare: kusamaJson as Record<string, unknown>,
data: kusamaData,
types: kusamaTypes as Record<string, unknown>
},
substrate: {
compare: substrateJson as Record<string, unknown>,
data: substrateData,
types: substrateTypes as Record<string, unknown>
}
}); });
File diff suppressed because one or more lines are too long
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import substrateData from '@polkadot/types-support/metadata/v9/substrate-hex';
import substrateJson from '@polkadot/types-support/metadata/v9/substrate-json.json';
import { testMeta } from '../util/testUtil'; import { testMeta } from '../util/testUtil';
import substrateData from './substrate-hex';
import substrateJson from './substrate-json.json';
testMeta(9, { testMeta(9, {
substrate: { substrate: {
@@ -1,9 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import rpcDataV11 from '@polkadot/types-support//metadata/v11/substrate-hex';
import { TypeRegistry } from '../create'; import { TypeRegistry } from '../create';
import { decorateStorage, Metadata } from '../metadata'; import { decorateStorage, Metadata } from '../metadata';
import rpcDataV11 from '../metadata/v11/substrate-hex';
import { StorageKey } from '.'; import { StorageKey } from '.';
describe('StorageKey', (): void => { describe('StorageKey', (): void => {
+3 -1
View File
@@ -22,7 +22,9 @@
"@polkadot/types": ["packages/types/src"], "@polkadot/types": ["packages/types/src"],
"@polkadot/types/*": ["packages/types/src/*"], "@polkadot/types/*": ["packages/types/src/*"],
"@polkadot/types-known": ["packages/types-known/src"], "@polkadot/types-known": ["packages/types-known/src"],
"@polkadot/types-known/*": ["packages/types-known/src/*"] "@polkadot/types-known/*": ["packages/types-known/src/*"],
"@polkadot/types-support": ["packages/types-support/src"],
"@polkadot/types-support/*": ["packages/types-support/src/*"]
}, },
"skipLibCheck": true, "skipLibCheck": true,
"typeRoots": [ "typeRoots": [
+10
View File
@@ -2074,6 +2074,7 @@ __metadata:
"@polkadot/api": 5.3.3-0 "@polkadot/api": 5.3.3-0
"@polkadot/rpc-provider": 5.3.3-0 "@polkadot/rpc-provider": 5.3.3-0
"@polkadot/types": 5.3.3-0 "@polkadot/types": 5.3.3-0
"@polkadot/types-support": 5.3.3-0
"@polkadot/util": ^7.1.1 "@polkadot/util": ^7.1.1
"@types/websocket": ^1.0.4 "@types/websocket": ^1.0.4
"@types/yargs": ^17.0.2 "@types/yargs": ^17.0.2
@@ -2100,12 +2101,21 @@ __metadata:
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@polkadot/types-support@5.3.3-0, @polkadot/types-support@workspace:packages/types-support":
version: 0.0.0-use.local
resolution: "@polkadot/types-support@workspace:packages/types-support"
dependencies:
"@babel/runtime": ^7.14.8
languageName: unknown
linkType: soft
"@polkadot/types@5.3.3-0, @polkadot/types@workspace:packages/types": "@polkadot/types@5.3.3-0, @polkadot/types@workspace:packages/types":
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@polkadot/types@workspace:packages/types" resolution: "@polkadot/types@workspace:packages/types"
dependencies: dependencies:
"@babel/runtime": ^7.14.8 "@babel/runtime": ^7.14.8
"@polkadot/keyring": ^7.1.1 "@polkadot/keyring": ^7.1.1
"@polkadot/types-support": 5.3.3-0
"@polkadot/util": ^7.1.1 "@polkadot/util": ^7.1.1
"@polkadot/util-crypto": ^7.1.1 "@polkadot/util-crypto": ^7.1.1
"@types/bn.js": ^4.11.6 "@types/bn.js": ^4.11.6