Files
common/packages/util-keyring/src/testingPairs.ts
T
Jaco Greeff 4470dfa7b9 TypeScript conversion (#142)
* Auto-conversion

* Cleanup type conversion errors

* Inching closer, resolution sorted

* Additional cleanups

* TS, TS everywhere

* Minor version for TS release

* Last roundups
2018-06-22 21:17:50 +02:00

27 lines
745 B
TypeScript

// Copyright 2017-2018 @polkadot/util-keyring authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
import { KeyringPair, KeyringInstance } from './types';
import createKeyring from './testing';
import nobody from './pair/nobody';
type TestKeyringMap = {
[index: string]: KeyringPair
};
export default function testKeyringPairs (): TestKeyringMap {
const keyring = createKeyring();
const pairs = keyring.getPairs();
return pairs.reduce((result, pair) => {
const { name } = pair.getMeta();
// @ts-ignore dunno what the complaint here is about...
result[name as string] = pair;
return result;
}, { 'nobody': nobody() });
}