Remove old known keys (#1715)

* Remove old known keys

* Don't import removed

* Update storage keys
This commit is contained in:
Jaco Greeff
2020-01-13 17:55:21 +01:00
committed by GitHub
parent 7b6397215d
commit 47d0e68f7d
3 changed files with 1 additions and 27 deletions
@@ -13,10 +13,6 @@ describe('storage', (): void => {
it('should return well known keys', (): void => {
expect(typeof storage.substrate).toBe('object');
// @deprecated: The ':auth:' (authorityPrefix) and ':auth:len' (authorityCount) storage keys
// have been removed in https://github.com/paritytech/substrate/pull/2802
expect(storage.substrate.authorityCount).toBeTruthy();
expect(storage.substrate.authorityPrefix).toBeTruthy();
expect(storage.substrate.changesTrieConfig).toBeTruthy();
expect(storage.substrate.childStorageKeyPrefix).toBeTruthy();
expect(storage.substrate.code).toBeTruthy();
@@ -4,21 +4,11 @@
import { TypeRegistry } from '@polkadot/types';
import { authorityCount, authorityPrefix, changesTrieConfig, childStorageKeyPrefix, code, extrinsicIndex, heapPages } from './substrate';
import { changesTrieConfig, childStorageKeyPrefix, code, extrinsicIndex, heapPages } from './substrate';
describe('substrate', (): void => {
const registry = new TypeRegistry();
// @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 => {
expect(authorityCount(registry, 8)()).toEqual(Uint8Array.from([36, 58, 97, 117, 116, 104, 58, 108, 101, 110])); // Length-prefixed
});
it('authorityPrefix should return the correct storage key', (): void => {
expect(authorityPrefix(registry, 8)()).toEqual(Uint8Array.from([24, 58, 97, 117, 116, 104, 58])); // Length-prefixed
});
it('changesTrieConfig should return the correct storage key', (): void => {
expect(changesTrieConfig(registry, 8)()).toEqual(Uint8Array.from([52, 58, 99, 104, 97, 110, 103, 101, 115, 95, 116, 114, 105, 101])); // Length-prefixed
});
@@ -31,18 +31,6 @@ function createRuntimeFunction (method: string, key: string, { documentation, ty
}, { key, metaVersion, skipHashing: true });
}
// @deprecated: The ':auth:' (authorityPrefix) and ':auth:len' (authorityCount) storage keys
// have been removed in https://github.com/paritytech/substrate/pull/2802
export const authorityCount = createRuntimeFunction('authorityCount', ':auth:len', {
documentation: 'Number of authorities.',
type: 'u32'
});
export const authorityPrefix = createRuntimeFunction('authorityPrefix', ':auth:', {
documentation: 'Prefix under which authorities are stored.',
type: 'u32'
});
export const code = createRuntimeFunction('code', ':code', {
documentation: 'Wasm code of the runtime.',
type: 'Bytes'