Some minor cleanups (#1966)
* Some minor cleanups * Small additions * Cleanup ExtrinsicEra decoding * Minor adjustments * Remove support for metadata v0 parsing * Adjust refCountDelay * refCountDelay comments * Adjust Metadata tests * Metadata default creation * Funky lines * Cleanup as AccountIdAndIndex * Some derive returns * Try and cleanup info extraction
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
// Copyright 2017-2020 @polkadot/metadata authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
|
||||
import Metadata from '../';
|
||||
import latestSubstrateV0 from './static-substrate.json';
|
||||
import rpcData from './static';
|
||||
import { defaultValues, toLatest } from '../util/testUtil';
|
||||
|
||||
describe('Metadata', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
it('decodes into latest substrate', (): void => {
|
||||
const metadata = new Metadata(registry, rpcData);
|
||||
const json = metadata.asV0.toJSON();
|
||||
|
||||
try {
|
||||
expect(metadata.version).toBe(0);
|
||||
expect(metadata.asV0.modules.length).not.toBe(0);
|
||||
expect(json).toEqual(latestSubstrateV0);
|
||||
} catch (error) {
|
||||
console.error(JSON.stringify(json));
|
||||
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
toLatest(registry, 0, rpcData, false);
|
||||
|
||||
defaultValues(registry, rpcData, false);
|
||||
});
|
||||
Reference in New Issue
Block a user