Remove combineLatest where multi is used (#895)

* Remove combineLatest where multi is used

* Add e2e test for derive.controllers
This commit is contained in:
Jaco Greeff
2019-05-10 12:06:02 +02:00
committed by GitHub
parent 52bae20ef4
commit 4378ed4bb8
3 changed files with 26 additions and 16 deletions
@@ -9,12 +9,6 @@ import { AccountId, Option } from '@polkadot/types';
import { drr } from '../util/drr';
function allBonds (api: ApiInterface$Rx, stashIds: Array<AccountId>) {
return combineLatest(
api.query.staking.bonded.multi(stashIds) as Observable<Option<AccountId>>
);
}
/**
* @description From the list of stash accounts, retrieve the list of controllers
*/
@@ -25,7 +19,7 @@ export function controllers (api: ApiInterface$Rx) {
switchMap(([stashIds]) =>
combineLatest([
of(stashIds),
allBonds(api, stashIds)
api.query.staking.bonded.multi(stashIds) as any as Observable<Array<Option<AccountId>>>
])
),
drr()