Files
api/packages/metadata/src/Metadata.spec.ts
T
2021-01-03 11:26:46 +01:00

18 lines
524 B
TypeScript

// Copyright 2017-2021 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types/create';
import { Metadata } from './Metadata';
import substrateData from './static';
describe('Metadata', (): void => {
it('allows creation from hex with JSON equivalence', (): void => {
const test = new Metadata(new TypeRegistry(), substrateData);
expect(
new Metadata(new TypeRegistry(), test.toHex()).toJSON()
).toEqual(test.toJSON());
});
});