Convert RPC classes to primitive classes or /srml types (#1192)
* Convert RPC classes to primitive classes or /srml types * Lint passes... lokking at tests next. * Tests pass. * Types with basic docs (lots of work here) * Update StorageKey.spec.ts * Add injector to metadata doc generation * Fix import
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { ClassOf, Metadata } from '@polkadot/types';
|
||||
import json from '@polkadot/types/Metadata/v6/static';
|
||||
import json from '@polkadot/types/Metadata/static';
|
||||
import { injectDefinitions } from '@polkadot/types/srml';
|
||||
|
||||
import fromMetadata from '../fromMetadata';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Metadata } from '@polkadot/types';
|
||||
import metadataRpc from '@polkadot/types/Metadata/v6/static';
|
||||
import metadataRpc from '@polkadot/types/Metadata/static';
|
||||
|
||||
import fromMetadata from './fromMetadata';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Metadata } from '@polkadot/types';
|
||||
import metadataRpc from '@polkadot/types/Metadata/v6/static';
|
||||
import metadataRpc from '@polkadot/types/Metadata/static';
|
||||
import { ModulesWithMethods } from '@polkadot/types/primitive/Method';
|
||||
|
||||
import fromMetadata from './fromMetadata';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import testingPairs from '@polkadot/keyring/testingPairs';
|
||||
import { Metadata } from '@polkadot/types';
|
||||
import json from '@polkadot/types/Metadata/v6/static';
|
||||
import json from '@polkadot/types/Metadata/static';
|
||||
import { injectDefinitions } from '@polkadot/types/srml';
|
||||
import { u8aToHex } from '@polkadot/util';
|
||||
|
||||
|
||||
@@ -2,9 +2,15 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { injectDefinitions } from '@polkadot/types/srml';
|
||||
|
||||
import { storage } from './storage';
|
||||
|
||||
describe('storage', (): void => {
|
||||
beforeEach((): void => {
|
||||
injectDefinitions();
|
||||
});
|
||||
|
||||
it('should return well known keys', (): void => {
|
||||
expect(typeof storage.substrate).toBe('object');
|
||||
|
||||
|
||||
@@ -2,9 +2,15 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { injectDefinitions } from '@polkadot/types/srml';
|
||||
|
||||
import { authorityCount, authorityPrefix, changesTrieConfig, childStorageKeyPrefix, code, extrinsicIndex, heapPages } from './substrate';
|
||||
|
||||
describe('substrate', (): void => {
|
||||
beforeEach((): void => {
|
||||
injectDefinitions();
|
||||
});
|
||||
|
||||
// @deprecated: The ':auth:' (authorityPrefix) and ':auth:len' (authorityCount) storage keys
|
||||
// have been removed in https://github.com/paritytech/substrate/pull/2802
|
||||
it('authorityCount should return the correct storage key', (): void => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import { StorageEntryMetadata, StorageEntryModifier, StorageEntryType } from '@polkadot/types/Metadata/v6/Storage';
|
||||
import { StorageEntry } from '@polkadot/types/primitive/StorageKey';
|
||||
import { Text, Vector } from '@polkadot/types';
|
||||
import { Text, Vec } from '@polkadot/types';
|
||||
|
||||
import createFunction from './createFunction';
|
||||
|
||||
@@ -18,7 +18,7 @@ const createRuntimeFunction = (method: string, key: string, { documentation, typ
|
||||
createFunction(
|
||||
{
|
||||
meta: {
|
||||
documentation: new Vector(Text, [documentation]),
|
||||
documentation: new Vec(Text, [documentation]),
|
||||
modifier: new StorageEntryModifier(1), // default
|
||||
type: new StorageEntryType(type, 0),
|
||||
toJSON: (): any => key
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Metadata } from '@polkadot/types';
|
||||
import metadataRpc from '@polkadot/types/Metadata/v6/static';
|
||||
import metadataRpc from '@polkadot/types/Metadata/static';
|
||||
|
||||
import fromMetadata from './fromMetadata';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user