Complexity adjustments (#2803)

* Complexity adjustments

* cleanups

* Small cleanups

* Additional

* revert era

* ExtrinsicEra
This commit is contained in:
Jaco Greeff
2020-10-29 14:20:10 +01:00
committed by GitHub
parent 63fd5baa8f
commit 94ebb321f1
15 changed files with 105 additions and 145 deletions
@@ -5,7 +5,7 @@ import { Signer, SignerResult } from '@polkadot/api/types';
import { KeyringPair } from '@polkadot/keyring/types';
import { Registry, SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import { hexToU8a, u8aToHex } from '@polkadot/util';
import { assert, hexToU8a, u8aToHex } from '@polkadot/util';
let id = 0;
@@ -23,9 +23,7 @@ export class SingleAccountSigner implements Signer {
}
public async signPayload (payload: SignerPayloadJSON): Promise<SignerResult> {
if (payload.address !== this.#keyringPair.address) {
throw new Error('does not have the keyringPair');
}
assert(payload.address === this.#keyringPair.address, 'Signer does not have the keyringPair');
return new Promise((resolve): void => {
setTimeout((): void => {
@@ -40,9 +38,7 @@ export class SingleAccountSigner implements Signer {
}
public async signRaw ({ address, data }: SignerPayloadRaw): Promise<SignerResult> {
if (address !== this.#keyringPair.address) {
throw new Error('does not have the keyringPair');
}
assert(address === this.#keyringPair.address, 'Signer does not have the keyringPair');
return new Promise((resolve): void => {
setTimeout((): void => {