Files
api/packages/api-metadata/src/consts/fromMetadata/fromMetadata.spec.ts
T
Jaco Greeff 096aa83dd7 Bump metadata (#1354)
* Bump metadata

* Update for metadata constants
2019-09-02 07:39:12 +02:00

22 lines
781 B
TypeScript

// Copyright 2017-2019 @polkadot/api-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 '@polkadot/types/injector';
import { ClassOf, Metadata } from '@polkadot/types';
import json from '@polkadot/types/Metadata/static';
import fromMetadata from '../fromMetadata';
// Use the pre-generated metadata
const metadata = new Metadata(json);
const consts = fromMetadata(metadata);
describe('fromMetadata', (): void => {
it('should return constants with the correct type and value', (): void => {
expect(consts.democracy.cooloffPeriod).toBeInstanceOf(ClassOf('BlockNumber'));
expect(consts.democracy.cooloffPeriod.toHex()).toEqual('0x000c4e00');
});
});