* Bump API

* Adjust for new API types

* Adjust staking const

* Attemp to fix build

* Attempt test-support build fix (try 2)
This commit is contained in:
Jaco 2023-10-15 14:42:49 +03:00 committed by GitHub
parent 046057167c
commit 22abc22a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 760 additions and 2295 deletions

View File

@ -69,12 +69,12 @@
"devDependencies": {
"@crustio/crust-pin": "^1.0.0",
"@pinata/sdk": "^1.2.1",
"@polkadot/dev": "^0.76.18",
"@polkadot/dev": "^0.76.29",
"@types/chart.js": "^2.9.37",
"@types/file-saver": "^2.0.5",
"@types/react-beautiful-dnd": "^13.1.4",
"@types/react-copy-to-clipboard": "^5.0.4",
"@types/react-dom": "^18.2.7",
"@types/react-dom": "^18.2.13",
"@types/react-router-dom": "^5.3.3",
"@types/store": "^2.0.2",
"concurrently": "^8.2.1",
@ -91,34 +91,34 @@
"source-map-explorer": "^2.5.3"
},
"resolutions": {
"@polkadot/api": "^10.9.1",
"@polkadot/api-augment": "^10.9.1",
"@polkadot/api-base": "^10.9.1",
"@polkadot/api-contract": "^10.9.1",
"@polkadot/api-derive": "^10.9.1",
"@polkadot/hw-ledger": "^12.4.2",
"@polkadot/keyring": "^12.4.2",
"@polkadot/networks": "^12.4.2",
"@polkadot/phishing": "^0.21.5",
"@polkadot/rpc-augment": "^10.9.1",
"@polkadot/rpc-core": "^10.9.1",
"@polkadot/rpc-provider": "^10.9.1",
"@polkadot/types": "^10.9.1",
"@polkadot/types-augment": "^10.9.1",
"@polkadot/types-codec": "^10.9.1",
"@polkadot/types-create": "^10.9.1",
"@polkadot/types-known": "^10.9.1",
"@polkadot/types-support": "^10.9.1",
"@polkadot/util": "^12.4.2",
"@polkadot/util-crypto": "^12.4.2",
"@polkadot/api": "^10.10.1",
"@polkadot/api-augment": "^10.10.1",
"@polkadot/api-base": "^10.10.1",
"@polkadot/api-contract": "^10.10.1",
"@polkadot/api-derive": "^10.10.1",
"@polkadot/hw-ledger": "^12.5.1",
"@polkadot/keyring": "^12.5.1",
"@polkadot/networks": "^12.5.1",
"@polkadot/phishing": "^0.21.6",
"@polkadot/rpc-augment": "^10.10.1",
"@polkadot/rpc-core": "^10.10.1",
"@polkadot/rpc-provider": "^10.10.1",
"@polkadot/types": "^10.10.1",
"@polkadot/types-augment": "^10.10.1",
"@polkadot/types-codec": "^10.10.1",
"@polkadot/types-create": "^10.10.1",
"@polkadot/types-known": "^10.10.1",
"@polkadot/types-support": "^10.10.1",
"@polkadot/util": "^12.5.1",
"@polkadot/util-crypto": "^12.5.1",
"@polkadot/wasm-crypto": "^7.2.2",
"@polkadot/x-bigint": "^12.4.2",
"@polkadot/x-fetch": "^12.4.2",
"@polkadot/x-global": "^12.4.2",
"@polkadot/x-randomvalues": "^12.4.2",
"@polkadot/x-textdecoder": "^12.4.2",
"@polkadot/x-textencoder": "^12.4.2",
"@polkadot/x-ws": "^12.4.2",
"typescript": "^5.1.6"
"@polkadot/x-bigint": "^12.5.1",
"@polkadot/x-fetch": "^12.5.1",
"@polkadot/x-global": "^12.5.1",
"@polkadot/x-randomvalues": "^12.5.1",
"@polkadot/x-textdecoder": "^12.5.1",
"@polkadot/x-textencoder": "^12.5.1",
"@polkadot/x-ws": "^12.5.1",
"typescript": "^5.2.2"
}
}

View File

@ -37,16 +37,16 @@
"@peaqnetwork/type-definitions": "0.0.4",
"@pendulum-chain/type-definitions": "0.3.7",
"@phala/typedefs": "0.2.33",
"@polkadot/api": "^10.9.1",
"@polkadot/api-derive": "^10.9.1",
"@polkadot/networks": "^12.4.2",
"@polkadot/react-identicon": "^3.6.2",
"@polkadot/types": "^10.9.1",
"@polkadot/types-codec": "^10.9.1",
"@polkadot/util": "^12.4.2",
"@polkadot/api": "^10.10.1",
"@polkadot/api-derive": "^10.10.1",
"@polkadot/networks": "^12.5.1",
"@polkadot/react-identicon": "^3.6.3",
"@polkadot/types": "^10.10.1",
"@polkadot/types-codec": "^10.10.1",
"@polkadot/util": "^12.5.1",
"@polkadot/wasm-util": "^7.2.2",
"@polkadot/x-fetch": "^12.4.2",
"@polkadot/x-ws": "^12.4.2",
"@polkadot/x-fetch": "^12.5.1",
"@polkadot/x-ws": "^12.5.1",
"@polymeshassociation/polymesh-types": "5.5.2",
"@snowfork/snowbridge-types": "0.2.7",
"@sora-substrate/type-definitions": "1.20.1",

View File

@ -22,7 +22,7 @@
"electron-updater": "^5.3.0"
},
"devDependencies": {
"@polkadot/dev": "^0.76.18",
"@polkadot/dev": "^0.76.29",
"@types/tmp": "^0.2.3",
"copy-webpack-plugin": "^11.0.0",
"electron": "25.0.1",

View File

@ -18,7 +18,7 @@
"dependencies": {
"@polkadot/apps-config": "^0.132.2-117-x",
"@polkadot/apps-routing": "^0.132.2-117-x",
"@polkadot/dev": "^0.76.18",
"@polkadot/dev": "^0.76.29",
"@polkadot/react-api": "^0.132.2-117-x",
"@polkadot/react-components": "^0.132.2-117-x",
"@polkadot/react-hooks": "^0.132.2-117-x",

View File

@ -16,11 +16,11 @@
"type": "module",
"version": "0.132.2-117-x",
"dependencies": {
"@polkadot/hw-ledger": "^12.4.2",
"@polkadot/phishing": "^0.21.5",
"@polkadot/hw-ledger": "^12.5.1",
"@polkadot/phishing": "^0.21.6",
"@polkadot/react-components": "^0.132.2-117-x",
"@polkadot/react-hooks": "^0.132.2-117-x",
"@polkadot/util": "^12.4.2",
"@polkadot/util": "^12.5.1",
"@polkadot/vanitygen": "^0.55.3",
"detect-browser": "^5.3.0",
"file-saver": "^2.0.5"

View File

@ -254,7 +254,7 @@ function useScheduledImpl (): EntryInfoTyped[] {
['democracyLaunch', api.consts.democracy?.launchPeriod],
['parachainLease', api.consts.slots?.leasePeriod as BlockNumber, BN_ONE, api.consts.slots?.leaseOffset as BlockNumber],
['societyChallenge', api.consts.society?.challengePeriod],
['societyRotate', api.consts.society?.rotationPeriod],
['societyRotate', api.consts.society?.rotationPeriod as BlockNumber],
['treasurySpend', api.consts.treasury?.spendPeriod]
]))
);

View File

@ -16,7 +16,7 @@
"type": "module",
"version": "0.132.2-117-x",
"dependencies": {
"@polkadot/api-contract": "^10.9.1",
"@polkadot/api-contract": "^10.10.1",
"eventemitter3": "^5.0.1"
},
"peerDependencies": {

View File

@ -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 { PolkadotPrimitivesV4CandidateReceipt } from '@polkadot/types/lookup';
import type { PolkadotPrimitivesV5CandidateReceipt } from '@polkadot/types/lookup';
import type { IEvent } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { EventMapInfo } from './types.js';
@ -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<[PolkadotPrimitivesV4CandidateReceipt]>).data[0];
const { descriptor } = (event as unknown as IEvent<[PolkadotPrimitivesV5CandidateReceipt]>).data[0];
if (descriptor?.paraId) {
map[descriptor.paraId.toString()] = {

View File

@ -25,7 +25,7 @@ const OPT_VOTES = {
transform: (members: DeriveSocietyMember[]): VoteType[] =>
members
.filter(({ vote }): boolean => !!vote)
.map(({ accountId, vote }): VoteType => [accountId.toString(), vote as SocietyVote])
.map(({ accountId, vote }): VoteType => [accountId.toString(), vote as unknown as SocietyVote])
};
function Defender ({ className = '', info, isMember, ownMembers }: Props): React.ReactElement<Props> | null {

View File

@ -36,22 +36,24 @@ function Summary ({ className = '', info, payoutTotal }: Props): React.ReactElem
<section className='media--1100'>
{info && members && (
<CardSummary label={t('members')}>
{members.length}&nbsp;/&nbsp;{info.maxMembers.toString()}
{members.length}&nbsp;/&nbsp;{info.maxMembers?.toString()}
</CardSummary>
)}
</section>
{bestNumber && (
<>
<section>
<CardSummary
label={t('rotation')}
progress={{
total: api.consts.society.rotationPeriod,
value: bestNumber.mod(api.consts.society.rotationPeriod),
withTime: true
}}
/>
</section>
{api.consts.society.rotationPeriod && (
<section>
<CardSummary
label={t('rotation')}
progress={{
total: api.consts.society.rotationPeriod as unknown as BN,
value: bestNumber.mod(api.consts.society.rotationPeriod as unknown as BN),
withTime: true
}}
/>
</section>
)}
<section className='media--1200'>
<CardSummary
label={t('challenge')}

View File

@ -90,7 +90,7 @@ function SocietyApp ({ basePath, className }: Props): React.ReactElement<Props>
const [mapMembers, payoutTotal] = useMemo(
() => members && info && skeptics && voters
? getMapMembers(members, skeptics, voters, info, api.consts.society.maxStrikes.mul(BN_TWO).div(BN_THREE))
? getMapMembers(members, skeptics, voters, info, (api.consts.society.graceStrikes || api.consts.society.maxStrikes).mul(BN_TWO).div(BN_THREE))
: [undefined, undefined],
[api, info, members, skeptics, voters]
);

View File

@ -27,7 +27,7 @@ async function getVoters (api: ApiPromise, candidates: DeriveSocietyCandidate[])
const key = accountId.toString();
const vote = opt.unwrap();
if (vote.isSkeptic) {
if ((vote as unknown as { isSkeptic: boolean }).isSkeptic) {
!skeptics.includes(key) && skeptics.push(key);
} else {
!voters.includes(key) && voters.push(key);

View File

@ -58,9 +58,11 @@ function Nominate ({ className = '', controllerId, nominating, onChange, poolId,
}
}, [api, onChange, poolId, selected]);
const maxNominations = api.consts.staking.maxNominations
? (api.consts.staking.maxNominations as BN).toNumber()
: MAX_NOMINATIONS;
const maxNominations = api.consts.staking.maxNominatorRewardedPerValidator
? api.consts.staking.maxNominatorRewardedPerValidator.toNumber()
: api.consts.staking.maxNominations
? (api.consts.staking.maxNominations as unknown as BN).toNumber()
: MAX_NOMINATIONS;
return (
<StyledDiv className={className}>

View File

@ -20,10 +20,10 @@
"path": false
},
"dependencies": {
"@polkadot/api": "^10.9.1",
"@polkadot/api": "^10.10.1",
"@polkadot/extension-compat-metamask": "^0.46.5",
"@polkadot/extension-dapp": "^0.46.5",
"@polkadot/rpc-provider": "^10.9.1",
"@polkadot/rpc-provider": "^10.10.1",
"fflate": "^0.8.0",
"rxjs": "^7.8.1"
},

View File

@ -19,15 +19,15 @@
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@polkadot/keyring": "^12.4.2",
"@polkadot/keyring": "^12.5.1",
"@polkadot/react-api": "^0.132.2-117-x",
"@polkadot/react-identicon": "^3.6.2",
"@polkadot/react-qr": "^3.6.2",
"@polkadot/react-identicon": "^3.6.3",
"@polkadot/react-qr": "^3.6.3",
"@polkadot/react-query": "^0.132.2-117-x",
"@polkadot/ui-keyring": "^3.6.2",
"@polkadot/ui-settings": "^3.6.2",
"@polkadot/util": "^12.4.2",
"@polkadot/util-crypto": "^12.4.2",
"@polkadot/ui-keyring": "^3.6.3",
"@polkadot/ui-settings": "^3.6.3",
"@polkadot/util": "^12.5.1",
"@polkadot/util-crypto": "^12.5.1",
"chart.js": "^4.3.3",
"chartjs-plugin-annotation": "^3.0.1",
"chartjs-plugin-crosshair": "^1.2.0",
@ -48,15 +48,15 @@
"semantic-ui-css": "^2.5.0",
"semantic-ui-react": "^0.88.2",
"store": "^2.0.12",
"styled-components": "^6.0.7",
"styled-components": "^6.0.8",
"styled-theming": "^2.2.0"
},
"devDependencies": {
"@types/chartjs-plugin-crosshair": "^1.1.1",
"@types/codeflask": "^1.4.3",
"@types/owasp-password-strength-test": "^1.3.0",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7"
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13"
},
"peerDependencies": {
"react": "*",

View File

@ -16,8 +16,8 @@
"type": "module",
"version": "0.132.2-117-x",
"dependencies": {
"@polkadot/hw-ledger": "^12.4.2",
"@polkadot/hw-ledger-transports": "^12.4.2",
"@polkadot/hw-ledger": "^12.5.1",
"@polkadot/hw-ledger-transports": "^12.5.1",
"is-ipfs": "^8.0.1"
},
"peerDependencies": {

View File

@ -16,7 +16,7 @@
"type": "module",
"version": "0.132.2-117-x",
"dependencies": {
"@polkadot/hw-ledger": "^12.4.2",
"@polkadot/hw-ledger": "^12.5.1",
"@polkadot/react-components": "^0.132.2-117-x"
},
"peerDependencies": {

View File

@ -20,7 +20,7 @@
"testcontainers": "^10.2.1"
},
"devDependencies": {
"@polkadot/types-support": "^10.9.1",
"@polkadot/types-support": "^10.10.1",
"@testing-library/jest-dom": "^5.16.5",
"tsconfig-paths": "^4.2.0"
},

View File

@ -5,6 +5,7 @@
"outDir": "./build",
"rootDir": "./src",
"module": "CommonJS",
"moduleResolution": "node",
"target": "es2018",
/* This is a cjs target, so ignore */
"verbatimModuleSyntax": false

2888
yarn.lock

File diff suppressed because it is too large Load Diff