Minor cleanups, no functionality (#1308)

* Minor cleanups, no functionality

* Shared fee parsing
This commit is contained in:
Jaco Greeff
2019-08-14 15:04:58 +02:00
committed by GitHub
parent fd962327b6
commit a39caccedc
2 changed files with 37 additions and 30 deletions
@@ -3,6 +3,7 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { AccountId } from '@polkadot/types/interfaces';
import { Codec } from '@polkadot/types/types';
import { Observable, combineLatest, of } from 'rxjs';
import { switchMap } from 'rxjs/operators';
@@ -16,7 +17,8 @@ import { drr } from '../util/drr';
*/
export function controllers (api: ApiInterfaceRx): () => Observable<[AccountId[], Option<AccountId>[]]> {
return (): Observable<[AccountId[], Option<AccountId>[]]> =>
(api.query.staking.validators() as any as Observable<[AccountId[], any]>)
api.query.staking
.validators<[AccountId[]] & Codec>()
.pipe(
switchMap(([stashIds]): Observable<[AccountId[], Option<AccountId>[]]> =>
combineLatest([