From cc0fda5ab4e3a3cffbfa5f1ca4d0d88fe7254cfa Mon Sep 17 00:00:00 2001 From: Jaco Date: Sun, 3 Oct 2021 09:05:55 +0300 Subject: [PATCH] Bump API (#6227) * Bump API * Updates * u128 as balance * update bounties test * More bounties --- package.json | 14 +- packages/apps-electron/package.json | 2 +- packages/apps/package.json | 2 +- packages/page-accounts/package.json | 4 +- packages/page-bounties/src/Bounties.spec.ts | 7 +- .../page-bounties/test/pages/bountiesPage.tsx | 10 +- packages/page-contracts/package.json | 2 +- .../page-democracy/src/Overview/Fasttrack.tsx | 2 +- packages/page-democracy/src/util.ts | 2 +- packages/react-api/package.json | 6 +- packages/test-support/package.json | 2 +- packages/test-support/src/creation/balance.ts | 10 +- .../src/creation/bounties/bountyFactory.ts | 13 +- .../src/creation/stakingInfo/stakingLedger.ts | 6 +- yarn.lock | 1988 ++++++----------- 15 files changed, 694 insertions(+), 1376 deletions(-) diff --git a/package.json b/package.json index 106047fcb0..1cae76430e 100644 --- a/package.json +++ b/package.json @@ -12,15 +12,15 @@ "packages/*" ], "resolutions": { - "@polkadot/api": "^6.0.5", - "@polkadot/api-contract": "^6.0.5", + "@polkadot/api": "^6.1.3-3", + "@polkadot/api-contract": "^6.1.3-3", "@polkadot/hw-ledger": "^7.4.1", "@polkadot/keyring": "^7.4.1", "@polkadot/networks": "^7.4.1", - "@polkadot/phishing": "^0.6.297", - "@polkadot/types": "^6.0.5", - "@polkadot/types-known": "^6.0.5", - "@polkadot/types-support": "^6.0.5", + "@polkadot/phishing": "^0.6.321", + "@polkadot/types": "^6.1.3-3", + "@polkadot/types-known": "^6.1.3-3", + "@polkadot/types-support": "^6.1.3-3", "@polkadot/util": "^7.4.1", "@polkadot/util-crypto": "^7.4.1", "@polkadot/wasm-crypto": "^4.2.1", @@ -73,7 +73,7 @@ "@babel/runtime": "^7.15.4", "@crustio/crust-pin": "^1.0.0", "@pinata/sdk": "^1.1.23", - "@polkadot/dev": "^0.62.67", + "@polkadot/dev": "^0.62.68", "@polkadot/ts": "^0.4.8", "@types/bn.js": "^4.11.6", "@types/chart.js": "^2.9.34", diff --git a/packages/apps-electron/package.json b/packages/apps-electron/package.json index 16b881fbae..971a4736f8 100644 --- a/packages/apps-electron/package.json +++ b/packages/apps-electron/package.json @@ -6,7 +6,7 @@ "dependencies": { "@babel/core": "^7.15.5", "@babel/polyfill": "^7.12.1", - "@polkadot/dev": "^0.62.67", + "@polkadot/dev": "^0.62.68", "@polkadot/react-components": "^0.96.2-36", "electron-log": "^4.3.5", "electron-updater": "^4.3.10" diff --git a/packages/apps/package.json b/packages/apps/package.json index 99f76fbb2d..162fa8d0fe 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -11,7 +11,7 @@ "@babel/runtime": "^7.15.4", "@polkadot/apps-config": "^0.96.2-36", "@polkadot/apps-routing": "^0.96.2-36", - "@polkadot/dev": "^0.62.67", + "@polkadot/dev": "^0.62.68", "@polkadot/react-api": "^0.96.2-36", "@polkadot/react-components": "^0.96.2-36", "@polkadot/react-hooks": "^0.96.2-36", diff --git a/packages/page-accounts/package.json b/packages/page-accounts/package.json index 00b1c18fdb..844de4f5aa 100644 --- a/packages/page-accounts/package.json +++ b/packages/page-accounts/package.json @@ -6,9 +6,9 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.15.4", - "@polkadot/phishing": "^0.6.297", + "@polkadot/phishing": "^0.6.321", "@polkadot/react-components": "^0.96.2-36", - "@polkadot/vanitygen": "^0.46.2", + "@polkadot/vanitygen": "^0.46.3-0", "detect-browser": "^5.2.1", "file-saver": "^2.0.5" }, diff --git a/packages/page-bounties/src/Bounties.spec.ts b/packages/page-bounties/src/Bounties.spec.ts index c5295c8beb..0284f16790 100644 --- a/packages/page-bounties/src/Bounties.spec.ts +++ b/packages/page-bounties/src/Bounties.spec.ts @@ -3,7 +3,8 @@ import type { SubmittableExtrinsic } from '@polkadot/api/types'; import type { DeriveCollectiveProposal } from '@polkadot/api-derive/types'; -import type { Bounty, BountyIndex, BountyStatus } from '@polkadot/types/interfaces'; +import type { BountyIndex, BountyStatus } from '@polkadot/types/interfaces'; +import type { PalletBountiesBounty } from '@polkadot/types/lookup'; import { fireEvent } from '@testing-library/react'; import BN from 'bn.js'; @@ -49,10 +50,10 @@ jest.mock('./hooks/useBounties', () => ({ let aProposal: (extrinsic: SubmittableExtrinsic<'promise'>, ayes?: string[], nays?: string[]) => DeriveCollectiveProposal; let augmentedApi: ApiPromise; -let aBounty: ({ status, value }?: Partial) => Bounty; +let aBounty: ({ status, value }?: Partial) => PalletBountiesBounty; let aBountyIndex: (index?: number) => BountyIndex; let bountyStatusWith: ({ curator, status, updateDue }: { curator?: string, status?: string, updateDue?: number}) => BountyStatus; -let bountyWith: ({ status, value }: { status?: string, value?: number }) => Bounty; +let bountyWith: ({ status, value }: { status?: string, value?: number }) => PalletBountiesBounty; describe('Bounties', () => { let bountiesPage: BountiesPage; diff --git a/packages/page-bounties/test/pages/bountiesPage.tsx b/packages/page-bounties/test/pages/bountiesPage.tsx index df96f00559..8ea86cdaae 100644 --- a/packages/page-bounties/test/pages/bountiesPage.tsx +++ b/packages/page-bounties/test/pages/bountiesPage.tsx @@ -1,6 +1,8 @@ // Copyright 2017-2021 @polkadot/app-bounties authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { PalletBountiesBounty } from '@polkadot/types/lookup'; + import { fireEvent, render, within } from '@testing-library/react'; import React, { Suspense } from 'react'; import { MemoryRouter } from 'react-router-dom'; @@ -19,7 +21,7 @@ import { PartialQueueTxExtrinsic, QueueProps, QueueTxExtrinsicAdd } from '@polka import { balanceOf } from '@polkadot/test-support/creation/balance'; import { BountyFactory } from '@polkadot/test-support/creation/bounties/bountyFactory'; import { TypeRegistry } from '@polkadot/types/create'; -import { Bounty, BountyIndex, BountyStatus } from '@polkadot/types/interfaces'; +import { BountyIndex, BountyStatus } from '@polkadot/types/interfaces'; import { mockBountyHooks } from '../hooks/defaults'; import { clickButtonWithName } from '../utils/clickButtonWithName'; @@ -51,11 +53,11 @@ interface RenderedBountiesPage { } export class BountiesPage { - aBounty: ({ status, value }?: Partial) => Bounty; + aBounty: ({ status, value }?: Partial) => PalletBountiesBounty; aBountyIndex: (index?: number) => BountyIndex; aBountyStatus: (status: string) => BountyStatus; bountyStatusWith: ({ curator, status }: { curator?: string, status?: string, }) => BountyStatus; - bountyWith: ({ status, value }: { status?: string, value?: number }) => Bounty; + bountyWith: ({ status, value }: { status?: string, value?: number }) => PalletBountiesBounty; findByRole?: FindOne; findByText?: FindOne; @@ -68,7 +70,7 @@ export class BountiesPage { ({ aBounty: this.aBounty, aBountyIndex: this.aBountyIndex, aBountyStatus: this.aBountyStatus, bountyStatusWith: this.bountyStatusWith, bountyWith: this.bountyWith } = new BountyFactory(api)); } - renderOne (bounty: Bounty, proposals: DeriveCollectiveProposal[] = [], description = '', index = this.aBountyIndex()): RenderedBountiesPage { + renderOne (bounty: PalletBountiesBounty, proposals: DeriveCollectiveProposal[] = [], description = '', index = this.aBountyIndex()): RenderedBountiesPage { return this.renderMany({ bounties: [{ bounty, description, index, proposals }] }); } diff --git a/packages/page-contracts/package.json b/packages/page-contracts/package.json index 5ccbee3de2..2b854e7664 100644 --- a/packages/page-contracts/package.json +++ b/packages/page-contracts/package.json @@ -6,6 +6,6 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.15.4", - "@polkadot/api-contract": "^6.0.5" + "@polkadot/api-contract": "^6.1.3-3" } } diff --git a/packages/page-democracy/src/Overview/Fasttrack.tsx b/packages/page-democracy/src/Overview/Fasttrack.tsx index 158221c153..db926d6b4f 100644 --- a/packages/page-democracy/src/Overview/Fasttrack.tsx +++ b/packages/page-democracy/src/Overview/Fasttrack.tsx @@ -155,7 +155,7 @@ function Fasttrack ({ imageHash, members, threshold }: Props): React.ReactElemen )}