From d17fd85bed116e794af8b7df3e671ce58000980d Mon Sep 17 00:00:00 2001 From: h3lpkey Date: Wed, 01 Jun 2022 11:21:51 +0000 Subject: [PATCH] fix: remove extra IF --- --- a/tests/src/substrate/substrate-api.ts +++ b/tests/src/substrate/substrate-api.ts @@ -14,17 +14,17 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import '../interfaces/augment-api-events'; -import {WsProvider, ApiPromise} from '@polkadot/api'; +import {ApiPromise, WsProvider} from '@polkadot/api'; +import {ApiOptions, ApiTypes, SubmittableExtrinsic} from '@polkadot/api/types'; +import {ExtrinsicStatus} from '@polkadot/types/interfaces/author/types'; import {EventRecord} from '@polkadot/types/interfaces/system/types'; -import {ExtrinsicStatus} from '@polkadot/types/interfaces/author/types'; import {IKeyringPair} from '@polkadot/types/types'; - import config from '../config'; -import promisifySubstrate from './promisify-substrate'; -import {ApiOptions, SubmittableExtrinsic, ApiTypes} from '@polkadot/api/types'; +import '../interfaces/augment-api-events'; import * as defs from '../interfaces/definitions'; import privateKey from './privateKey'; +import promisifySubstrate from './promisify-substrate'; + function defaultApiOptions(): ApiOptions { @@ -88,12 +88,9 @@ await promisifySubstrate(api, async () => { if (api) { await api.isReadyOrError; - const chainProperties = api.registry.getChainProperties(); - if (chainProperties) { - const ss58Format = (chainProperties).toHuman().ss58Format; - const privateKeyWrapper = (account: string) => privateKey(account, Number(ss58Format)); - result = await action(api, privateKeyWrapper); - } + const ss58Format = (api.registry.getChainProperties())!.toHuman().ss58Format; + const privateKeyWrapper = (account: string) => privateKey(account, Number(ss58Format)); + result = await action(api, privateKeyWrapper); } })(); } finally { -- gitstuff