Metadata v7 (#1182)

* Make a start... static is in, code copied as a start.

* Get exports (more-or-less) right

* Well, the v7/* tests pass... now just to tweak storage generation

* Linting is happy, it doesn't mean it will work...

* It compiles... ship it.
This commit is contained in:
Jaco Greeff
2019-07-24 21:34:51 +02:00
committed by GitHub
parent 2a3cc92e91
commit 79e5f7c9cc
32 changed files with 4568 additions and 73 deletions
@@ -14,7 +14,7 @@ import { stringCamelCase } from '@polkadot/util';
* @param metadata - The metadata
*/
export default function fromMetadata (metadata: Metadata): Constants {
return metadata.asV6.modules.reduce((result, moduleMetadata): Constants => {
return metadata.asV7.modules.reduce((result, moduleMetadata): Constants => {
if (moduleMetadata.constants.isEmpty) {
return result;
}
+2 -2
View File
@@ -3,10 +3,10 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { Codec } from '@polkadot/types/types';
import { ModuleConstantMetadata as MetaV6 } from '@polkadot/types/Metadata/v6/Constants';
import { ModuleConstantMetadata as MetaV7 } from '@polkadot/types/Metadata/v6/Constants';
export interface ConstantCodec extends Codec {
meta: MetaV6;
meta: MetaV7;
}
export type ModuleConstants = Record<string, Codec>;