Cleanups for bestNumber derives (#4318)
* Cleanups for bestNumber derives * Unused imports * Re-exports of types for *.d.ts outputs
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { Collective } from './types';
|
||||
|
||||
// We are re-exporting these from here to ensure that *.d.ts generation is correct
|
||||
export type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
|
||||
export function getInstance (api: ApiInterfaceRx, section: string): string {
|
||||
const instances = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), section);
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@ import { isFunction } from '@polkadot/util';
|
||||
import { memo } from '../util';
|
||||
import { withSection } from './helpers';
|
||||
|
||||
// We are re-exporting these from here to ensure that *.d.ts generation is correct
|
||||
export type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
export type { AccountId } from '@polkadot/types/interfaces';
|
||||
|
||||
export function members (_section: Collective): (instanceId: string, api: ApiInterfaceRx) => () => Observable<AccountId[]> {
|
||||
return withSection(_section, (section, instanceId, api) =>
|
||||
memo(instanceId, (): Observable<AccountId[]> =>
|
||||
|
||||
@@ -14,6 +14,10 @@ import { isFunction } from '@polkadot/util';
|
||||
import { memo } from '../util';
|
||||
import { withSection } from './helpers';
|
||||
|
||||
// We are re-exporting these from here to ensure that *.d.ts generation is correct
|
||||
export type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
export type { AccountId } from '@polkadot/types/interfaces';
|
||||
|
||||
export function prime (_section: Collective): (instanceId: string, api: ApiInterfaceRx) => () => Observable<AccountId | null> {
|
||||
return withSection(_section, (section, instanceId, api) =>
|
||||
memo(instanceId, (): Observable<AccountId | null> =>
|
||||
|
||||
@@ -15,6 +15,11 @@ import { isFunction } from '@polkadot/util';
|
||||
import { memo } from '../util';
|
||||
import { withSection } from './helpers';
|
||||
|
||||
// We are re-exporting these from here to ensure that *.d.ts generation is correct
|
||||
export type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
export type { Option, u32 } from '@polkadot/types';
|
||||
export type { Hash, Proposal, Votes } from '@polkadot/types/interfaces';
|
||||
|
||||
type Result = [(Hash | Uint8Array | string)[], (Option<Proposal> | null)[], Option<Votes>[]];
|
||||
|
||||
function parse (api: ApiInterfaceRx, [hashes, proposals, votes]: Result): DeriveCollectiveProposal[] {
|
||||
|
||||
Reference in New Issue
Block a user