Convert all type/* (and some primitives) to srml/* (#1189)
* Convert (almost-all) non-primitives (and some primitives) to srml/* * Move Vote to primitives, remove type folder * Move Balance :-o * Fixup tests, override Balance.toRaw()
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Metadata, BlockNumber } from '@polkadot/types';
|
||||
import { ClassOf, Metadata } from '@polkadot/types';
|
||||
import json from '@polkadot/types/Metadata/v6/static';
|
||||
import { injectDefinitions } from '@polkadot/types/srml';
|
||||
|
||||
@@ -16,7 +16,7 @@ const consts = fromMetadata(metadata);
|
||||
|
||||
describe('fromMetadata', (): void => {
|
||||
it('should return constants with the correct type and value', (): void => {
|
||||
expect(consts.democracy.cooloffPeriod).toBeInstanceOf(BlockNumber);
|
||||
expect(consts.democracy.cooloffPeriod).toBeInstanceOf(ClassOf('BlockNumber'));
|
||||
expect(consts.democracy.cooloffPeriod.eq(432000)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import testingPairs from '@polkadot/keyring/testingPairs';
|
||||
import { injectDefinitions } from '@polkadot/types/srml';
|
||||
import { Extrinsic } from '@polkadot/types';
|
||||
|
||||
import extrinsics from './static';
|
||||
@@ -10,6 +11,10 @@ import extrinsics from './static';
|
||||
const keyring = testingPairs({ type: 'ed25519' }, false);
|
||||
|
||||
describe('extrinsics', (): void => {
|
||||
beforeEach((): void => {
|
||||
injectDefinitions();
|
||||
});
|
||||
|
||||
it('encodes an actual transfer (actual data)', (): void => {
|
||||
expect(
|
||||
new Extrinsic(
|
||||
|
||||
Reference in New Issue
Block a user