Bump deps (w/ specific chain types) (#5809)
This commit is contained in:
parent
4b49b01957
commit
355559d622
34
package.json
34
package.json
@ -12,15 +12,15 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"@polkadot/api": "^4.17.2-19",
|
||||
"@polkadot/api-contract": "^4.17.2-19",
|
||||
"@polkadot/hw-ledger": "^6.11.2-16",
|
||||
"@polkadot/keyring": "^6.11.2-16",
|
||||
"@polkadot/networks": "^6.11.2-16",
|
||||
"@polkadot/phishing": "^0.6.220",
|
||||
"@polkadot/types": "^4.17.2-19",
|
||||
"@polkadot/util": "^6.11.2-16",
|
||||
"@polkadot/util-crypto": "^6.11.2-16",
|
||||
"@polkadot/api": "^5.0.1",
|
||||
"@polkadot/api-contract": "^5.0.1",
|
||||
"@polkadot/hw-ledger": "^7.0.1",
|
||||
"@polkadot/keyring": "^7.0.1",
|
||||
"@polkadot/networks": "^7.0.1",
|
||||
"@polkadot/phishing": "^0.6.222",
|
||||
"@polkadot/types": "^5.0.1",
|
||||
"@polkadot/util": "^7.0.1",
|
||||
"@polkadot/util-crypto": "^7.0.1",
|
||||
"@polkadot/wasm-crypto": "^4.1.2",
|
||||
"@substrate/connect": "0.3.10",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
@ -76,15 +76,15 @@
|
||||
"@polkadot/dev": "^0.62.57",
|
||||
"@polkadot/ts": "^0.4.4",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"@types/chart.js": "^2.9.32",
|
||||
"@types/file-saver": "^2.0.2",
|
||||
"@types/jest": "^26.0.23",
|
||||
"@types/react-beautiful-dnd": "^13.0.0",
|
||||
"@types/react-copy-to-clipboard": "^5.0.0",
|
||||
"@types/react-dom": "^17.0.8",
|
||||
"@types/react-router-dom": "^5.1.7",
|
||||
"@types/chart.js": "^2.9.34",
|
||||
"@types/file-saver": "^2.0.3",
|
||||
"@types/jest": "^26.0.24",
|
||||
"@types/react-beautiful-dnd": "^13.1.1",
|
||||
"@types/react-copy-to-clipboard": "^5.0.1",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/react-router-dom": "^5.1.8",
|
||||
"@types/store": "^2.0.2",
|
||||
"@types/styled-components": "^5.1.10",
|
||||
"@types/styled-components": "^5.1.11",
|
||||
"@types/styled-theming": "^2.2.5",
|
||||
"concurrently": "^6.2.0",
|
||||
"devtron": "^1.4.0",
|
||||
|
||||
@ -7,26 +7,26 @@
|
||||
"sideEffects": true,
|
||||
"repository": "github:polkadot-js/apps",
|
||||
"dependencies": {
|
||||
"@acala-network/type-definitions": "^1.0.2-2",
|
||||
"@acala-network/type-definitions": "1.0.2-2",
|
||||
"@babel/runtime": "^7.14.6",
|
||||
"@crustio/type-definitions": "0.0.10",
|
||||
"@darwinia/types": "^1.1.4",
|
||||
"@digitalnative/type-definitions": "^1.1.9",
|
||||
"@docknetwork/node-types": "^0.4.6",
|
||||
"@edgeware/node-types": "^3.6.1-wako",
|
||||
"@darwinia/types": "1.1.5",
|
||||
"@digitalnative/type-definitions": "1.1.9",
|
||||
"@docknetwork/node-types": "0.4.6",
|
||||
"@edgeware/node-types": "3.6.2-wako",
|
||||
"@equilab/definitions": "1.2.6",
|
||||
"@interlay/polkabtc-types": "^0.7.4",
|
||||
"@kiltprotocol/type-definitions": "^0.1.8",
|
||||
"@laminar/type-definitions": "^0.3.1",
|
||||
"@phala/typedefs": "^0.2.1",
|
||||
"@polkadot/networks": "^6.11.2-16",
|
||||
"@polymathnetwork/polymesh-types": "^0.0.2",
|
||||
"@snowfork/snowbridge-types": "^0.2.3",
|
||||
"@sora-substrate/type-definitions": "^1.3.32",
|
||||
"@subsocial/types": "^0.5.9-dev.2",
|
||||
"@zeitgeistpm/type-defs": "^0.2.0",
|
||||
"@interlay/polkabtc-types": "0.7.4",
|
||||
"@kiltprotocol/type-definitions": "0.1.8",
|
||||
"@laminar/type-definitions": "0.3.1",
|
||||
"@phala/typedefs": "0.2.1",
|
||||
"@polkadot/networks": "^7.0.1",
|
||||
"@polymathnetwork/polymesh-types": "0.0.2",
|
||||
"@snowfork/snowbridge-types": "0.2.3",
|
||||
"@sora-substrate/type-definitions": "1.3.34",
|
||||
"@subsocial/types": "0.5.9-dev.2",
|
||||
"@zeitgeistpm/type-defs": "0.2.0",
|
||||
"moonbeam-types-bundle": "1.1.23",
|
||||
"pontem-types-bundle": "^1.0.5"
|
||||
"pontem-types-bundle": "1.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"i18next": "^19.9.2"
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
"electron-updater": "^4.3.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react-dom": "^17.0.8",
|
||||
"@types/tmp": "^0.2.0",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/tmp": "^0.2.1",
|
||||
"babel-loader": "^8.2.2",
|
||||
"copy-webpack-plugin": "^7.0.0",
|
||||
"html-webpack-plugin": "^4.5.2",
|
||||
|
||||
@ -6,9 +6,9 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.6",
|
||||
"@polkadot/phishing": "^0.6.220",
|
||||
"@polkadot/phishing": "^0.6.222",
|
||||
"@polkadot/react-components": "^0.94.2-61",
|
||||
"@polkadot/vanitygen": "^0.41.2-0",
|
||||
"@polkadot/vanitygen": "^0.42.1",
|
||||
"detect-browser": "^5.2.0",
|
||||
"file-saver": "^2.0.5"
|
||||
},
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.6",
|
||||
"@polkadot/api-contract": "^4.17.2-19"
|
||||
"@polkadot/api-contract": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,18 +3,30 @@
|
||||
|
||||
import type { ApiPromise } from '@polkadot/api';
|
||||
import type { DeriveSocietyCandidate } from '@polkadot/api-derive/types';
|
||||
import type { Option } from '@polkadot/types';
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { Voters } from './types';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { useApi, useCall, useEventTrigger } from '@polkadot/react-hooks';
|
||||
|
||||
const EMPTY: Voters = { candidates: [], skeptics: [], voters: [] };
|
||||
const transformDefender = {
|
||||
transform: (opt: Option<AccountId>) => opt.unwrapOr(null)
|
||||
};
|
||||
|
||||
async function getVoters (api: ApiPromise, candidates: DeriveSocietyCandidate[]): Promise<Voters> {
|
||||
const entries = await Promise.all(
|
||||
candidates.map(({ accountId }) => api.query.society.votes.entries(accountId))
|
||||
);
|
||||
async function getVoters (api: ApiPromise, defender: AccountId | null | undefined, candidates: DeriveSocietyCandidate[]): Promise<Voters> {
|
||||
const accountIds: AccountId[] = defender
|
||||
? [defender]
|
||||
: [];
|
||||
|
||||
candidates.forEach(({ accountId }): void => {
|
||||
accountIds.push(accountId);
|
||||
});
|
||||
|
||||
const entries = accountIds.length
|
||||
? await Promise.all(accountIds.map((a) => api.query.society.votes.entries(a)))
|
||||
: [];
|
||||
const skeptics: string[] = [];
|
||||
const voters: string[] = [];
|
||||
|
||||
@ -40,15 +52,15 @@ export default function useVoters (): Voters {
|
||||
const { api } = useApi();
|
||||
const voteTrigger = useEventTrigger([api.events.society.Vote]);
|
||||
const candidates = useCall<DeriveSocietyCandidate[]>(api.derive.society.candidates);
|
||||
const defender = useCall<AccountId | null>(api.query.society.defender, undefined, transformDefender);
|
||||
const [state, setState] = useState<Voters>({});
|
||||
|
||||
useEffect((): void => {
|
||||
voteTrigger && candidates && (
|
||||
candidates.length
|
||||
? getVoters(api, candidates).then(setState).catch(console.error)
|
||||
: setState(EMPTY)
|
||||
);
|
||||
}, [api, candidates, voteTrigger]);
|
||||
console.log('useEffect', voteTrigger, candidates);
|
||||
|
||||
voteTrigger && candidates &&
|
||||
getVoters(api, defender, candidates).then(setState).catch(console.error);
|
||||
}, [api, candidates, defender, voteTrigger]);
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.6",
|
||||
"@polkadot/api": "^4.17.2-19",
|
||||
"@polkadot/extension-dapp": "^0.38.9-0",
|
||||
"@polkadot/api": "^5.0.1",
|
||||
"@polkadot/extension-dapp": "^0.39.1",
|
||||
"@substrate/connect": "^0.3.10",
|
||||
"fflate": "^0.7.1",
|
||||
"rxjs": "^7.2.0"
|
||||
|
||||
@ -9,15 +9,15 @@
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
||||
"@fortawesome/react-fontawesome": "^0.1.14",
|
||||
"@polkadot/keyring": "^6.11.2-16",
|
||||
"@polkadot/keyring": "^7.0.1",
|
||||
"@polkadot/react-api": "^0.94.2-61",
|
||||
"@polkadot/react-identicon": "^0.83.2-5",
|
||||
"@polkadot/react-qr": "^0.83.2-5",
|
||||
"@polkadot/react-identicon": "^0.84.1",
|
||||
"@polkadot/react-qr": "^0.84.1",
|
||||
"@polkadot/react-query": "^0.94.2-61",
|
||||
"@polkadot/ui-keyring": "^0.83.2-5",
|
||||
"@polkadot/ui-settings": "^0.83.2-5",
|
||||
"@polkadot/util": "^6.11.2-16",
|
||||
"@polkadot/util-crypto": "^6.11.2-16",
|
||||
"@polkadot/ui-keyring": "^0.84.1",
|
||||
"@polkadot/ui-settings": "^0.84.1",
|
||||
"@polkadot/util": "^7.0.1",
|
||||
"@polkadot/util-crypto": "^7.0.1",
|
||||
"chart.js": "^2.9.4",
|
||||
"codeflask": "^1.4.1",
|
||||
"i18next": "^19.9.2",
|
||||
@ -41,7 +41,7 @@
|
||||
"styled-theming": "^2.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/codeflask": "^1.4.2",
|
||||
"@types/codeflask": "^1.4.3",
|
||||
"@types/owasp-password-strength-test": "^1.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user