Move (some) from session & elections to srml/types (#1158)
* Move (some) from session & elections to srml/types * Just use createType instad of (new ClassOf(type))(value) * Cleanup generation script (import file duplication)
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { SessionIndex } from '@polkadot/types/srml/session/types';
|
||||
|
||||
import { HeaderExtended } from '@polkadot/api-derive';
|
||||
import WsProvider from '@polkadot/rpc-provider/ws';
|
||||
import { LinkageResult } from '@polkadot/types/codec/Linkage';
|
||||
import { EventRecord, Hash, Header, Option, SessionIndex, Vector } from '@polkadot/types';
|
||||
import { EventRecord, Hash, Header, Option, Vector, createType } from '@polkadot/types';
|
||||
|
||||
import ApiPromise from '../../../src/promise';
|
||||
import describeE2E from '../../util/describeE2E';
|
||||
@@ -126,7 +128,7 @@ describeE2E()('Promise e2e queries', (wsUrl): void => {
|
||||
it('gets correct key', async (): Promise<void> => {
|
||||
const key = api.query.session.currentIndex.key();
|
||||
const sessionIndexData = await api.rpc.state.getStorage(key) as Option<any>;
|
||||
const sessionIndexRPC = new SessionIndex(sessionIndexData.unwrapOr(undefined));
|
||||
const sessionIndexRPC = createType<SessionIndex>('SessionIndex', sessionIndexData.unwrapOr(undefined));
|
||||
|
||||
expect(sessionIndexRPC.toNumber()).toBeGreaterThanOrEqual(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user