Update v14 types (#3771)
This commit is contained in:
@@ -77,7 +77,8 @@ export default {
|
||||
V10: 'MetadataV10',
|
||||
V11: 'MetadataV11',
|
||||
V12: 'MetadataV12',
|
||||
V13: 'MetadataV13'
|
||||
V13: 'MetadataV13',
|
||||
V14: 'MetadataV14'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,8 @@ export interface MetadataAll extends Enum {
|
||||
readonly asV12: MetadataV12;
|
||||
readonly isV13: boolean;
|
||||
readonly asV13: MetadataV13;
|
||||
readonly isV14: boolean;
|
||||
readonly asV14: MetadataV14;
|
||||
}
|
||||
|
||||
/** @name MetadataLatest */
|
||||
@@ -326,6 +328,7 @@ export interface SignedExtensionMetadataLatest extends SignedExtensionMetadataV1
|
||||
export interface SignedExtensionMetadataV14 extends Struct {
|
||||
readonly identifier: Text;
|
||||
readonly type: SiLookupTypeId;
|
||||
readonly additionalSigned: SiLookupTypeId;
|
||||
}
|
||||
|
||||
/** @name StorageEntryMetadataLatest */
|
||||
|
||||
@@ -64,7 +64,8 @@ export const v14: DefinitionsTypes = {
|
||||
},
|
||||
SignedExtensionMetadataV14: {
|
||||
identifier: 'Text',
|
||||
type: 'SiLookupTypeId'
|
||||
type: 'SiLookupTypeId',
|
||||
additionalSigned: 'SiLookupTypeId'
|
||||
},
|
||||
StorageEntryMetadataV14: {
|
||||
name: 'Text',
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright 2017-2021 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { MetadataAll } from '../../interfaces/metadata';
|
||||
|
||||
import { TypeRegistry } from '../../create';
|
||||
import { Metadata } from '../Metadata';
|
||||
import substrateData from './static';
|
||||
|
||||
describe('MetadataV14 (substrate)', (): void => {
|
||||
it('parses', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const metadata = new Metadata(registry, substrateData);
|
||||
const all = metadata.get('metadata') as MetadataAll;
|
||||
|
||||
expect(all).toBeDefined();
|
||||
|
||||
// console.log(JSON.stringify(all.toJSON()));
|
||||
console.log(JSON.stringify(
|
||||
all.asV14.types.types.map((t, __INDEX) => ({
|
||||
__INDEX,
|
||||
...t.toJSON()
|
||||
}))
|
||||
));
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user