Skip to content

Commit

Permalink
Hex/JSON metadata split (#3829)
Browse files Browse the repository at this point in the history
* Hex/JSON metadata split

* revert import change

* Adjust imports

* Update tests
  • Loading branch information
jacogr committed Jul 30, 2021
1 parent beff353 commit 7c4c346
Show file tree
Hide file tree
Showing 28 changed files with 24 additions and 40 deletions.
Expand Up @@ -7,7 +7,7 @@ import type { Constants } from '../types';
import { TypeRegistry } from '../../../create';
import { Metadata } from '../../Metadata';
import rpcMetadata from '../../static-substrate';
import rpcMetadataV10 from '../../v10/static-substrate';
import rpcMetadataV10 from '../../v10/hex/static-substrate';
import { decorateConstants } from '..';

function init (meta: string): [Constants, TypeRegistry] {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/metadata/static-polkadot.ts
@@ -1,6 +1,6 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0

import metadata from './v13/static-polkadot';
import metadata from './v13/hex/static-polkadot';

export default metadata;
2 changes: 1 addition & 1 deletion packages/types/src/metadata/static-substrate.ts
@@ -1,6 +1,6 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0

import metadata from './v13/static-substrate';
import metadata from './v13/hex/static-substrate';

export default metadata;
6 changes: 2 additions & 4 deletions packages/types/src/metadata/v10/Metadata.spec.ts
Expand Up @@ -3,10 +3,8 @@

import { TypeRegistry } from '../../create';
import { decodeLatestMeta, defaultValues, toLatest } from '../util/testUtil';
// eslint-disable-next-line import/no-duplicates
import substrateData from './static-substrate';
// eslint-disable-next-line import/no-duplicates
import substrateJson from './static-substrate.json';
import substrateData from './hex/static-substrate';
import substrateJson from './json/static-substrate.json';

describe('MetadataV10 (substrate)', (): void => {
const registry = new TypeRegistry();
Expand Down
6 changes: 2 additions & 4 deletions packages/types/src/metadata/v11/Metadata.spec.ts
Expand Up @@ -3,10 +3,8 @@

import { TypeRegistry } from '../../create';
import { decodeLatestMeta, defaultValues, toLatest } from '../util/testUtil';
// eslint-disable-next-line import/no-duplicates
import substrateData from './static-substrate';
// eslint-disable-next-line import/no-duplicates
import substrateJson from './static-substrate.json';
import substrateData from './hex/static-substrate';
import substrateJson from './json/static-substrate.json';

describe('MetadataV11 (substrate)', (): void => {
const registry = new TypeRegistry();
Expand Down
6 changes: 2 additions & 4 deletions packages/types/src/metadata/v12/Metadata.spec.ts
Expand Up @@ -3,10 +3,8 @@

import { TypeRegistry } from '../../create';
import { decodeLatestMeta, defaultValues, toLatest } from '../util/testUtil';
// eslint-disable-next-line import/no-duplicates
import substrateData from './static-substrate';
// eslint-disable-next-line import/no-duplicates
import substrateJson from './static-substrate.json';
import substrateData from './hex/static-substrate';
import substrateJson from './json/static-substrate.json';

describe('MetadataV12 (substrate)', (): void => {
const registry = new TypeRegistry();
Expand Down
12 changes: 4 additions & 8 deletions packages/types/src/metadata/v13/Metadata.spec.ts
Expand Up @@ -3,14 +3,10 @@

import { TypeRegistry } from '../../create';
import { decodeLatestMeta, defaultValues, toLatest } from '../util/testUtil';
// eslint-disable-next-line import/no-duplicates
import polkadotData from './static-polkadot';
// eslint-disable-next-line import/no-duplicates
import polkadotJson from './static-polkadot.json';
// eslint-disable-next-line import/no-duplicates
import substrateData from './static-substrate';
// eslint-disable-next-line import/no-duplicates
import substrateJson from './static-substrate.json';
import polkadotData from './hex/static-polkadot';
import substrateData from './hex/static-substrate';
import polkadotJson from './json/static-polkadot.json';
import substrateJson from './json/static-substrate.json';

describe('MetadataV13 (substrate)', (): void => {
const registry = new TypeRegistry();
Expand Down
16 changes: 6 additions & 10 deletions packages/types/src/metadata/v14/Metadata.spec.ts
Expand Up @@ -5,16 +5,12 @@ import type { MetadataAll } from '../../interfaces/metadata';

import { TypeRegistry } from '../../create';
import { Metadata } from '../Metadata';
// eslint-disable-next-line import/no-duplicates
import polkadotData from './static-polkadot';
// eslint-disable-next-line import/no-duplicates
import polkadotJson from './static-polkadot.json';
import polkadotTypes from './static-polkadot-types.json';
// eslint-disable-next-line import/no-duplicates
import substrateData from './static-substrate';
// eslint-disable-next-line import/no-duplicates
import substrateJson from './static-substrate.json';
import substrateTypes from './static-substrate-types.json';
import polkadotData from './hex/static-polkadot';
import substrateData from './hex/static-substrate';
import polkadotJson from './json/static-polkadot.json';
import polkadotTypes from './json/static-polkadot-types.json';
import substrateJson from './json/static-substrate.json';
import substrateTypes from './json/static-substrate-types.json';

describe('MetadataV14 (substrate)', (): void => {
// FIXME This is to be replaced with the proper version (here as a stop-gap)
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -4659,7 +4659,7 @@
{
"name": "IgnoredIssuance",
"type": 6,
"value": "0x9c33ee170e636c010000000000000000",
"value": "0x00000000000000000000000000000000",
"docs": [
" The issuance to ignore. This is subtracted from the `Currency`'s `total_issuance` to get",
" the issuance by which we inflate or deflate the gilt."
Expand Down
6 changes: 2 additions & 4 deletions packages/types/src/metadata/v9/Metadata.spec.ts
Expand Up @@ -3,10 +3,8 @@

import { TypeRegistry } from '../../create';
import { decodeLatestMeta, defaultValues, toLatest } from '../util/testUtil';
// eslint-disable-next-line import/no-duplicates
import substrateData from './static-substrate';
// eslint-disable-next-line import/no-duplicates
import substrateJson from './static-substrate.json';
import substrateData from './hex/static-substrate';
import substrateJson from './json/static-substrate.json';

describe('MetadataV9 (substrate)', (): void => {
const registry = new TypeRegistry();
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/primitive/StorageKey.spec.ts
Expand Up @@ -3,7 +3,7 @@

import { TypeRegistry } from '../create';
import { decorateStorage, Metadata } from '../metadata';
import rpcDataV11 from '../metadata/v11/static-substrate';
import rpcDataV11 from '../metadata/v11/hex/static-substrate';
import { StorageKey } from '.';

describe('StorageKey', (): void => {
Expand Down

0 comments on commit 7c4c346

Please sign in to comment.