mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-14 19:31:03 +00:00
@@ -3,8 +3,9 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Prefix } from '@polkadot/keyring/address/types';
|
||||
import { KeyringInstance, KeyringPair, KeyringOptions } from '@polkadot/keyring/types';
|
||||
import { KeyringInstance, KeyringPair } from '@polkadot/keyring/types';
|
||||
import { AddressSubject } from './observable/types';
|
||||
import { KeyringOptions } from './types';
|
||||
|
||||
import testKeyring from '@polkadot/keyring/testing';
|
||||
import { isBoolean, isString } from '@polkadot/util';
|
||||
@@ -82,7 +83,7 @@ export default class Base {
|
||||
env.set(isDevelopment);
|
||||
}
|
||||
|
||||
protected initKeyring (options: KeyringOptions & { isDevelopment?: boolean }): void {
|
||||
protected initKeyring (options: KeyringOptions): void {
|
||||
const keyring = testKeyring({ addressPrefix: this._prefix, ...options });
|
||||
|
||||
if (isBoolean(options.isDevelopment)) {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { KeyringPair, KeyringPair$Meta, KeyringPair$Json, KeyringOptions } from '@polkadot/keyring/types';
|
||||
import { KeyringPair, KeyringPair$Meta, KeyringPair$Json } from '@polkadot/keyring/types';
|
||||
import { SingleAddress } from './observable/types';
|
||||
import { KeyringAddress, KeyringJson, KeyringJson$Meta, KeyringStruct } from './types';
|
||||
import { KeyringAddress, KeyringJson, KeyringJson$Meta, KeyringOptions, KeyringStruct } from './types';
|
||||
|
||||
import store from 'store';
|
||||
import createPair from '@polkadot/keyring/pair';
|
||||
|
||||
+2
-2
@@ -8,11 +8,11 @@ describe('KeyringOption', () => {
|
||||
it('should not allow initOptions to be called more than once', () => {
|
||||
const state = {};
|
||||
// first call
|
||||
keyringOptionInstance.init(state);
|
||||
keyringOptionInstance.init(state as any);
|
||||
|
||||
// second call
|
||||
expect(() => {
|
||||
keyringOptionInstance.init(state);
|
||||
keyringOptionInstance.init(state as any);
|
||||
}).toThrowError('Unable to initialise options more than once');
|
||||
});
|
||||
});
|
||||
@@ -2,9 +2,13 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { KeyringInstance as BaseKeyringInstance, KeyringPair, KeyringPair$Meta, KeyringPair$Json, KeyringOptions } from '@polkadot/keyring/types';
|
||||
import { KeyringInstance as BaseKeyringInstance, KeyringPair, KeyringPair$Meta, KeyringPair$Json, KeyringOptions as KeyringOptionsBase } from '@polkadot/keyring/types';
|
||||
import { AddressSubject, SingleAddress } from './observable/types';
|
||||
|
||||
export type KeyringOptions = KeyringOptionsBase & {
|
||||
isDevelopment?: boolean
|
||||
};
|
||||
|
||||
export type KeyringJson$Meta = {
|
||||
isRecent?: boolean,
|
||||
isTesting?: boolean,
|
||||
|
||||
Reference in New Issue
Block a user