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:
Stefanie Doll
2019-05-09 09:53:15 +02:00
committed by GitHub
parent 04c401f777
commit adec070434
3 changed files with 2 additions and 9 deletions
-1
View File
@@ -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(),
+1 -4
View File
@@ -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>>
);
}