Move (some) from session & elections to srml/types (#1158)
* Move (some) from session & elections to srml/types * Just use createType instad of (new ClassOf(type))(value) * Cleanup generation script (import file duplication)
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { SetIndex } from '@polkadot/types/srml/elections/types';
|
||||
|
||||
import { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AccountId, Vector, SetIndex, ApprovalFlag } from '@polkadot/types';
|
||||
import { AccountId, Vector, ApprovalFlag } from '@polkadot/types';
|
||||
import { switchMap, map } from 'rxjs/operators';
|
||||
import { approvalFlagsToBools } from '../util/approvalFlagsToBools';
|
||||
import { drr } from '../util/drr';
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { SetIndex } from '@polkadot/types/srml/elections/types';
|
||||
|
||||
import { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AccountId, Vector, SetIndex, ApprovalFlag } from '@polkadot/types';
|
||||
import { AccountId, Vector, ApprovalFlag } from '@polkadot/types';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { approvalFlagsToBools } from '../util/approvalFlagsToBools';
|
||||
import { drr } from '../util/drr';
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { SetIndex } from '@polkadot/types/srml/elections/types';
|
||||
|
||||
import BN from 'bn.js';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import { AccountId, BlockNumber, SetIndex, VoteIndex } from '@polkadot/types';
|
||||
import { AccountId, BlockNumber, VoteIndex } from '@polkadot/types';
|
||||
|
||||
import { DerivedElectionsInfo } from '../types';
|
||||
import { drr } from '../util/drr';
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { SetIndex } from '@polkadot/types/srml/elections/types';
|
||||
|
||||
import { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AccountId, Vector, Option, SetIndex } from '@polkadot/types';
|
||||
import { AccountId, Vector, Option, createType } from '@polkadot/types';
|
||||
import { switchMap, map } from 'rxjs/operators';
|
||||
import { drr } from '../util/drr';
|
||||
|
||||
@@ -34,7 +36,7 @@ export function voterSets (api: ApiInterfaceRx): () => Observable<Record<string,
|
||||
const accountId: AccountId | null = e.unwrapOr(null);
|
||||
|
||||
if (accountId) {
|
||||
result[accountId.toString()] = new SetIndex(setIndex);
|
||||
result[accountId.toString()] = createType<SetIndex>('SetIndex', setIndex);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { SetIndex } from '@polkadot/types/srml/elections/types';
|
||||
|
||||
import { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AccountId, Vector, SetIndex } from '@polkadot/types';
|
||||
import { AccountId, Vector } from '@polkadot/types';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { drr } from '../util/drr';
|
||||
import { voterSets } from './voterSets';
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { SessionKey, Keys } from '@polkadot/types/srml/session/types';
|
||||
|
||||
import { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import { DerivedStaking, DerivedUnlocking } from '../types';
|
||||
|
||||
import BN from 'bn.js';
|
||||
import { combineLatest, Observable, of } from 'rxjs';
|
||||
import { map, switchMap } from 'rxjs/operators';
|
||||
import { AccountId, BlockNumber, Exposure, Keys, Option, RewardDestination, SessionKey, StakingLedger, Tuple, ValidatorPrefs, Vector, UnlockChunk } from '@polkadot/types';
|
||||
import { AccountId, BlockNumber, Exposure, Option, RewardDestination, StakingLedger, Tuple, ValidatorPrefs, Vector, UnlockChunk } from '@polkadot/types';
|
||||
|
||||
import { isUndefined } from '@polkadot/util';
|
||||
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { SetIndex } from '@polkadot/types/srml/elections/types';
|
||||
|
||||
import BN from 'bn.js';
|
||||
import { AccountId, Balance, BlockNumber, Exposure, Index, RewardDestination, SetIndex, StakingLedger, ValidatorPrefs, Vote, VoteIndex } from '@polkadot/types';
|
||||
import { AccountId, Balance, BlockNumber, Exposure, Index, RewardDestination, StakingLedger, ValidatorPrefs, Vote, VoteIndex } from '@polkadot/types';
|
||||
|
||||
export interface DerivedBalances {
|
||||
accountId: AccountId;
|
||||
|
||||
Reference in New Issue
Block a user