Support for alliance motion derives (#5113)

* Support for alliance motion derives

* allianceMotion
This commit is contained in:
Jaco
2022-07-28 11:46:45 +03:00
committed by GitHub
parent 30f72f915e
commit b22b26d021
5 changed files with 24 additions and 4 deletions
+3 -2
View File
@@ -4,8 +4,8 @@
- **Breaking change** The decorated field getters on `Struct` were moved to the prototype class for performance reasons. While `struct.<field>` access still behaves in the same way, with the same results, this does mean that the prototype getters are not visible when doing an `Object.keys(struct)` or when doing an object spread.
- **Breaking change** Deprecated interfaces have been removed including `tx.sign(...)` (use `signAsync`), `Result.{is, as}Error` (use `{is, as}Err`) as well as storage `.range(...)` operations.
- **Breaking change** Only current Substrate contracts pallets are supported. This means `api-contract` will detect the usage of `storageDepositLimit` in params, if not available the contract interfaces will not be available.
- **Breaking change** Deprecated call interfaces on `api-contract` have been removed. Always ensure you pass an options options to construction and queries.
- **Breaking change** Contracts access via `api-contract` will now detect the usage of `storageDepositLimit` in params, if not available the contract interfaces will not be decorated.
- **Breaking change** Deprecated call interfaces on `api-contract` have been removed. Always ensure you pass an options object to construction and query methods.
Changes:
@@ -14,6 +14,7 @@ Changes:
- Drop support for contract runtimes without `storageDepositLimit` (runtime `contractsApi` only has support for latest)
- Export `api.rx.call.*` for internal usage (derive, contracts)
- Remove old-style param passing as opposed to options in `api-contract`
- Support for alliance/motion collective derives
- Add Kusama 9260 upgrade block
- Add Polkadot 9230 & 9250 upgrade blocks
- Add Westend 9251, 9260 & 9261 upgrade blocks
@@ -0,0 +1,14 @@
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { hasProposals as collectiveHasProposals, members as collectiveMembers, prime as collectivePrime, proposal as collectiveProposal, proposalCount as collectiveProposalCount, proposalHashes as collectiveProposalHashes, proposals as collectiveProposals } from '../collective';
export const members = collectiveMembers('allianceMotion');
export const hasProposals = collectiveHasProposals('allianceMotion');
export const proposal = collectiveProposal('allianceMotion');
export const proposalCount = collectiveProposalCount('allianceMotion');
export const proposalHashes = collectiveProposalHashes('allianceMotion');
export const proposals = collectiveProposals('allianceMotion');
export const prime = collectivePrime('allianceMotion');
+4
View File
@@ -22,6 +22,10 @@ export { lazyDeriveSection };
// Enable derive only if some of these modules are available
const checks: Record<string, Avail> = {
allianceMotion: {
instances: ['allianceMotion'],
methods: []
},
bagsList: {
instances: ['voterList', 'bagsList'],
methods: [],
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
export type Collective = 'council' | 'membership' | 'technicalCommittee';
export type Collective = 'allianceMotion' | 'council' | 'membership' | 'technicalCommittee';
+2 -1
View File
@@ -4,6 +4,7 @@
import type { AnyFunction } from '@polkadot/types/types';
import * as accounts from './accounts';
import * as allianceMotion from './allianceMotion';
import * as bagsList from './bagsList';
import * as balances from './balances';
import * as bounties from './bounties';
@@ -23,7 +24,7 @@ import * as technicalCommittee from './technicalCommittee';
import * as treasury from './treasury';
import * as tx from './tx';
export const derive = { accounts, bagsList, balances, bounties, chain, contracts, council, crowdloan, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx };
export const derive = { accounts, allianceMotion, bagsList, balances, bounties, chain, contracts, council, crowdloan, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx };
type DeriveSection<Section> = {
[M in keyof Section]: Section[M] extends AnyFunction