multi calls for democracy.votes and staking.controllers (#887)
* .multi for democracy.votes & stating.controllers * Removed leftover comment from https://github.com/polkadot-js/api/pull/875 * no new line at the end
This commit is contained in:
@@ -12,7 +12,6 @@ import { drr } from '../util/drr';
|
||||
|
||||
export function fees (api: ApiInterface$Rx) {
|
||||
return (): Observable<DerivedFees> => {
|
||||
// FIXME Remove fees checks, only use balances (fees is a removed module now)
|
||||
return (combineLatest([
|
||||
api.query.balances.creationFee(),
|
||||
api.query.balances.existentialDeposit(),
|
||||
|
||||
@@ -14,10 +14,7 @@ export function votes (api: ApiInterface$Rx) {
|
||||
return !accountIds || !accountIds.length
|
||||
? of([]).pipe(drr())
|
||||
: combineLatest(
|
||||
// FIXME Convert to multi
|
||||
accountIds.map(
|
||||
(accountId) => api.query.democracy.voteOf([referendumId, accountId]) as Observable<Vote>
|
||||
)
|
||||
api.query.democracy.voteOf.multi(accountIds.map(accountId => [referendumId, accountId])) as Observable<Vote>
|
||||
).pipe(
|
||||
drr()
|
||||
);
|
||||
|
||||
@@ -11,10 +11,7 @@ import { drr } from '../util/drr';
|
||||
|
||||
function allBonds (api: ApiInterface$Rx, stashIds: Array<AccountId>) {
|
||||
return combineLatest(
|
||||
// FIXME Convert to multi
|
||||
stashIds.map((id) =>
|
||||
(api.query.staking.bonded(id) as Observable<Option<AccountId>>)
|
||||
)
|
||||
api.query.staking.bonded.multi(stashIds) as Observable<Option<AccountId>>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user