Skip to content

Commit

Permalink
Bump @polkadot/* deps (#10378)
Browse files Browse the repository at this point in the history
* Bump `@polkadot/*` deps

* fix linting errors

* more fixes

* fix nit
  • Loading branch information
TarikGul authored Mar 21, 2024
1 parent 8e11975 commit 8f1c183
Show file tree
Hide file tree
Showing 14 changed files with 244 additions and 251 deletions.
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,24 @@
"source-map-explorer": "^2.5.3"
},
"resolutions": {
"@polkadot/api": "^10.12.2",
"@polkadot/api-augment": "^10.12.2",
"@polkadot/api-base": "^10.12.2",
"@polkadot/api-contract": "^10.12.2",
"@polkadot/api-derive": "^10.12.2",
"@polkadot/api": "^10.12.4",
"@polkadot/api-augment": "^10.12.4",
"@polkadot/api-base": "^10.12.4",
"@polkadot/api-contract": "^10.12.4",
"@polkadot/api-derive": "^10.12.4",
"@polkadot/hw-ledger": "^12.6.2",
"@polkadot/keyring": "^12.6.2",
"@polkadot/networks": "^12.6.2",
"@polkadot/phishing": "^0.22.3",
"@polkadot/rpc-augment": "^10.12.2",
"@polkadot/rpc-core": "^10.12.2",
"@polkadot/rpc-provider": "^10.12.2",
"@polkadot/types": "^10.12.2",
"@polkadot/types-augment": "^10.12.2",
"@polkadot/types-codec": "^10.12.2",
"@polkadot/types-create": "^10.12.2",
"@polkadot/types-known": "^10.12.2",
"@polkadot/types-support": "^10.12.2",
"@polkadot/phishing": "^0.22.4",
"@polkadot/rpc-augment": "^10.12.4",
"@polkadot/rpc-core": "^10.12.4",
"@polkadot/rpc-provider": "^10.12.4",
"@polkadot/types": "^10.12.4",
"@polkadot/types-augment": "^10.12.4",
"@polkadot/types-codec": "^10.12.4",
"@polkadot/types-create": "^10.12.4",
"@polkadot/types-known": "^10.12.4",
"@polkadot/types-support": "^10.12.4",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/wasm-crypto": "^7.3.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/apps-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
"@peaqnetwork/type-definitions": "0.0.4",
"@pendulum-chain/type-definitions": "0.3.8",
"@phala/typedefs": "0.2.33",
"@polkadot/api": "^10.12.2",
"@polkadot/api-derive": "^10.12.2",
"@polkadot/api": "^10.12.4",
"@polkadot/api-derive": "^10.12.4",
"@polkadot/networks": "^12.6.2",
"@polkadot/react-identicon": "^3.6.5",
"@polkadot/types": "^10.12.2",
"@polkadot/types-codec": "^10.12.2",
"@polkadot/types": "^10.12.4",
"@polkadot/types-codec": "^10.12.4",
"@polkadot/util": "^12.6.2",
"@polkadot/wasm-util": "^7.3.2",
"@polkadot/x-fetch": "^12.6.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/apps-routing/src/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import type { ApiPromise } from '@polkadot/api';
import type { u32, Vec } from '@polkadot/types';
import type { PalletStakingExposure, PalletStakingStakingLedger } from '@polkadot/types/lookup';
import type { PalletStakingStakingLedger, SpStakingExposure } from '@polkadot/types/lookup';
import type { Route, TFunction } from './types.js';

import Component from '@polkadot/app-staking';
Expand All @@ -14,7 +14,7 @@ import { assert, BN_ONE } from '@polkadot/util';
function needsApiCheck (api: ApiPromise): boolean {
try {
// we need a known Exposure type
const { others: [{ value, who }], own, total } = api.registry.createType<PalletStakingExposure>(
const { others: [{ value, who }], own, total } = api.registry.createType<SpStakingExposure>(
unwrapStorageType(api.registry, api.query.staking.erasStakers.creator.meta.type),
{ others: [{ value: BN_ONE, who: ZERO_ACCOUNT }], own: BN_ONE, total: BN_ONE }
);
Expand Down
4 changes: 2 additions & 2 deletions packages/apps-routing/src/staking2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { ApiPromise } from '@polkadot/api';
import type { PalletStakingExposure } from '@polkadot/types/lookup';
import type { SpStakingExposure } from '@polkadot/types/lookup';
import type { Route, TFunction } from './types.js';

import Component from '@polkadot/app-staking2';
Expand All @@ -13,7 +13,7 @@ import { assert, BN_ONE } from '@polkadot/util';
function needsApiCheck (api: ApiPromise): boolean {
try {
// we need a known Exposure type
const { others: [{ value, who }], own, total } = api.registry.createType<PalletStakingExposure>(
const { others: [{ value, who }], own, total } = api.registry.createType<SpStakingExposure>(
unwrapStorageType(api.registry, api.query.staking.erasStakers.creator.meta.type),
{ others: [{ value: BN_ONE, who: ZERO_ACCOUNT }], own: BN_ONE, total: BN_ONE }
);
Expand Down
4 changes: 2 additions & 2 deletions packages/page-accounts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"version": "0.134.2-10-x",
"dependencies": {
"@polkadot/hw-ledger": "^12.6.2",
"@polkadot/phishing": "^0.22.3",
"@polkadot/phishing": "^0.22.4",
"@polkadot/react-components": "^0.134.2-10-x",
"@polkadot/react-hooks": "^0.134.2-10-x",
"@polkadot/util": "^12.6.2",
"@polkadot/vanitygen": "^0.56.5",
"@polkadot/vanitygen": "^0.56.6",
"detect-browser": "^5.3.0",
"file-saver": "^2.0.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/page-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"type": "module",
"version": "0.134.2-10-x",
"dependencies": {
"@polkadot/api-contract": "^10.12.2",
"@polkadot/api-contract": "^10.12.4",
"eventemitter3": "^5.0.1"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/page-parachains/src/Overview/Parachain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function Parachain ({ bestNumber, className = '', id, lastBacked, lastInclusion,
<StyledTr className={`${className} ${(lastBacked || lastInclusion || paraInfo.watermark) ? '' : 'isDisabled'}`}>
<Table.Column.Id value={id} />
<td className='badge together'>
{paraInfo.paraInfo?.locked?.isFalse
{paraInfo.paraInfo?.locked?.isSome && paraInfo.paraInfo?.locked?.unwrap().isFalse
? (
<Badge
color='orange'
Expand Down
4 changes: 2 additions & 2 deletions packages/page-parachains/src/Overview/useEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import type { ApiPromise } from '@polkadot/api';
import type { SignedBlockExtended } from '@polkadot/api-derive/types';
import type { Event } from '@polkadot/types/interfaces';
import type { PolkadotPrimitivesV5CandidateReceipt } from '@polkadot/types/lookup';
import type { PolkadotPrimitivesV6CandidateReceipt } from '@polkadot/types/lookup';
import type { IEvent } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { EventMapInfo } from './types.js';
Expand All @@ -26,7 +26,7 @@ const EMPTY_EVENTS: Result = { lastBacked: {}, lastIncluded: {}, lastTimeout: {}

function includeEntry (map: EventMap, event: Event, blockHash: string, blockNumber: BN): void {
try {
const { descriptor } = (event as unknown as IEvent<[PolkadotPrimitivesV5CandidateReceipt]>).data[0];
const { descriptor } = (event as unknown as IEvent<[PolkadotPrimitivesV6CandidateReceipt]>).data[0];

if (descriptor?.paraId) {
map[descriptor.paraId.toString()] = {
Expand Down
4 changes: 2 additions & 2 deletions packages/page-parachains/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

import type { AccountId, AuctionIndex, BalanceOf, BlockNumber, LeasePeriodOf, ParachainProposal, ParaId, SessionIndex } from '@polkadot/types/interfaces';
import type { PolkadotParachainPrimitivesHrmpChannelId, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsHrmpHrmpChannel } from '@polkadot/types/lookup';
import type { PolkadotParachainPrimitivesPrimitivesHrmpChannelId, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsHrmpHrmpChannel } from '@polkadot/types/lookup';
import type { BN } from '@polkadot/util';

export type ChannelMap = Record<string, [PolkadotParachainPrimitivesHrmpChannelId, PolkadotRuntimeParachainsHrmpHrmpChannel][]>;
export type ChannelMap = Record<string, [PolkadotParachainPrimitivesPrimitivesHrmpChannelId, PolkadotRuntimeParachainsHrmpHrmpChannel][]>;

export interface AllChannels {
dst: ChannelMap;
Expand Down
6 changes: 3 additions & 3 deletions packages/page-staking2/src/Validators/useExposure.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2017-2024 @polkadot/app-staking authors & contributors
// SPDX-License-Identifier: Apache-2.0

import type { PalletStakingExposure } from '@polkadot/types/lookup';
import type { SpStakingExposure } from '@polkadot/types/lookup';
import type { SessionInfo, Validator } from '../types.js';
import type { UseExposure, UseExposureExposure } from './types.js';

Expand All @@ -13,13 +13,13 @@ import { BN } from '@polkadot/util';
import { useCacheMap } from '../useCache.js';

const OPT_EXPOSURE = {
transform: ({ others, own, total }: PalletStakingExposure): UseExposureExposure => ({
transform: ({ others, own, total }: SpStakingExposure): UseExposureExposure => ({
others: others
.map(({ value, who }) => ({
value: value.unwrap(),
who: who.toString()
}))
.sort((a, b) => b.value.cmp(a.value)),
.sort((a, b) => (b.value as BN).cmp(a.value)),
own: own.unwrap(),
total: total.unwrap()
})
Expand Down
8 changes: 4 additions & 4 deletions packages/react-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"path": false
},
"dependencies": {
"@polkadot/api": "^10.12.2",
"@polkadot/extension-compat-metamask": "^0.46.8",
"@polkadot/extension-dapp": "^0.46.8",
"@polkadot/rpc-provider": "^10.12.2",
"@polkadot/api": "^10.12.4",
"@polkadot/extension-compat-metamask": "^0.46.9",
"@polkadot/extension-dapp": "^0.46.9",
"@polkadot/rpc-provider": "^10.12.4",
"fflate": "^0.8.1",
"rxjs": "^7.8.1"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/react-components/src/Status/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import '@polkadot/api-augment/substrate';

import type { DispatchError, DispatchResult, Event, EventRecord } from '@polkadot/types/interfaces';
import type { XcmV3TraitsOutcome } from '@polkadot/types/lookup';
import type { StagingXcmV4TraitsOutcome } from '@polkadot/types/lookup';

type EventCheck = (event: Event) => string | null;

Expand Down Expand Up @@ -41,8 +41,8 @@ function dispatchResultMulti ({ data: [,,,, result] }: Event): string | null {
function xcmAttempted ({ data: [outcome] }: Event): string | null {
if (!outcome) {
return INCOMPLETE;
} else if ((outcome as XcmV3TraitsOutcome).isIncomplete) {
const [, error] = (outcome as XcmV3TraitsOutcome).asIncomplete;
} else if ((outcome as StagingXcmV4TraitsOutcome).isIncomplete) {
const error = (outcome as StagingXcmV4TraitsOutcome).asIncomplete.error;

return `error: ${error.type}`;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/test-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"testcontainers": "^10.4.0"
},
"devDependencies": {
"@polkadot/types-support": "^10.12.2",
"@polkadot/types-support": "^10.12.4",
"@testing-library/jest-dom": "^5.17.0",
"tsconfig-paths": "^4.2.0"
},
Expand Down
Loading

0 comments on commit 8f1c183

Please sign in to comment.