mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-10-20 18:56:30 +00:00
fix: add eslint-disable for unsafe member access and fix webpack header
This commit is contained in:
1 parent
ade75e7078
commit
e64f846b0d
3 files changed
+5
-1
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2017-2026 @polkadot/apps authors & contributors
|
// Copyright 2017-2026 @pezkuwi/apps-electron authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
|
|||||||
@@ -19,11 +19,13 @@ function needsApiCheck (api: ApiPromise): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we need a known Exposure type
|
// we need a known Exposure type
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
const { nominatorCount, own, pageCount, total } = api.registry.createType<SpStakingPagedExposureMetadata>(
|
const { nominatorCount, own, pageCount, total } = api.registry.createType<SpStakingPagedExposureMetadata>(
|
||||||
unwrapStorageType(api.registry, api.query.staking.erasStakersOverview.creator.meta.type),
|
unwrapStorageType(api.registry, api.query.staking.erasStakersOverview.creator.meta.type),
|
||||||
{ nominatorCount: BN_ONE, own: BN_ONE, pageCount: BN_ONE, total: BN_ONE }
|
{ nominatorCount: BN_ONE, own: BN_ONE, pageCount: BN_ONE, total: BN_ONE }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
||||||
assert(total && own && nominatorCount && pageCount && total.eq(BN_ONE) && own.eq(BN_ONE), 'Needs a known Exposure type');
|
assert(total && own && nominatorCount && pageCount && total.eq(BN_ONE) && own.eq(BN_ONE), 'Needs a known Exposure type');
|
||||||
} catch {
|
} catch {
|
||||||
console.warn('Unable to create known-shape Exposure type, disabling staking route');
|
console.warn('Unable to create known-shape Exposure type, disabling staking route');
|
||||||
|
|||||||
@@ -13,11 +13,13 @@ import { assert, BN_ONE } from '@pezkuwi/util';
|
|||||||
function needsApiCheck (api: ApiPromise): boolean {
|
function needsApiCheck (api: ApiPromise): boolean {
|
||||||
try {
|
try {
|
||||||
// we need a known Exposure type
|
// we need a known Exposure type
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
const { others: [{ value, who }], own, total } = api.registry.createType<SpStakingExposure>(
|
const { others: [{ value, who }], own, total } = api.registry.createType<SpStakingExposure>(
|
||||||
unwrapStorageType(api.registry, api.query.staking.erasStakers.creator.meta.type),
|
unwrapStorageType(api.registry, api.query.staking.erasStakers.creator.meta.type),
|
||||||
{ others: [{ value: BN_ONE, who: ZERO_ACCOUNT }], own: BN_ONE, total: BN_ONE }
|
{ others: [{ value: BN_ONE, who: ZERO_ACCOUNT }], own: BN_ONE, total: BN_ONE }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
||||||
assert(total && own && value && who && total.eq(BN_ONE) && own.eq(BN_ONE) && value.eq(BN_ONE), 'Needs a known Exposure type');
|
assert(total && own && value && who && total.eq(BN_ONE) && own.eq(BN_ONE) && value.eq(BN_ONE), 'Needs a known Exposure type');
|
||||||
} catch {
|
} catch {
|
||||||
console.warn('Unable to create known-shape Exposure type, disabling staking route');
|
console.warn('Unable to create known-shape Exposure type, disabling staking route');
|
||||||
|
|||||||
Reference in new issue
Block a user