Bump deps (#861)

* Bump deps

* Align with published common

* Fix rxjs to 6.4.0 (false deprecations on 6.5.1)
This commit is contained in:
Jaco Greeff
2019-05-27 15:46:30 +12:00
committed by ian.he
parent 86cb0962bc
commit 9f5be747e7
24 changed files with 53 additions and 53 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import { drr } from '../util/drr';
export function fees (api: ApiInterface$Rx) {
return (): Observable<DerivedFees> => {
return (combineLatest(
return (combineLatest([
api.query.balances.creationFee(),
api.query.balances.existentialDeposit(),
api.query.fees
@@ -22,7 +22,7 @@ export function fees (api: ApiInterface$Rx) {
? api.query.fees.transactionByteFee()
: api.query.balances.transactionByteFee(),
api.query.balances.transferFee()
) as any as Observable<[BN, BN, BN, BN, BN]>).pipe(
]) as any as Observable<[BN, BN, BN, BN, BN]>).pipe(
map(([creationFee, existentialDeposit, transactionBaseFee, transactionByteFee, transferFee]) => ({
creationFee,
existentialDeposit,
@@ -15,10 +15,10 @@ import { votingBalancesNominatorsFor } from './votingBalancesNominatorsFor';
export function validatingBalance (api: ApiInterface$Rx) {
return (address: AccountId | AccountIndex | Address | string): Observable<DerivedBalances> => {
return combineLatest(
return combineLatest([
votingBalance(api)(address),
votingBalancesNominatorsFor(api)(address)
).pipe(
]).pipe(
map(([balance, nominators]) => {
const nominatedBalance = nominators.reduce(
(total: BN, nominatorBalance: DerivedBalances) =>
@@ -18,11 +18,11 @@ export function votingBalance (api: ApiInterface$Rx) {
return idAndIndex(api)(address).pipe(
switchMap(([accountId]) =>
(accountId
? combineLatest(
? combineLatest([
of(accountId),
api.query.balances.freeBalance(accountId),
api.query.balances.reservedBalance(accountId)
)
])
: of([undefined, undefined, undefined])
) as Observable<[AccountId?, Balance?, Balance?]>
),
@@ -14,6 +14,6 @@ export function votingBalances (api: ApiInterface$Rx) {
return (addresses?: Array<AccountId | AccountIndex | Address | string>): Observable<Array<DerivedBalances>> => {
return !addresses || !addresses.length
? of([]).pipe(drr())
: combineLatest(...addresses.map(votingBalance(api))).pipe(drr());
: combineLatest(addresses.map(votingBalance(api))).pipe(drr());
};
}
@@ -24,10 +24,10 @@ import { bestNumberFinalized } from './bestNumberFinalized';
*/
export function bestNumberLag (api: ApiInterface$Rx) {
return (): Observable<BlockNumber> =>
combineLatest(
combineLatest([
bestNumber(api)(),
bestNumberFinalized(api)()
).pipe(
]).pipe(
map(([bestNumber, bestNumberFinalized]) =>
new BlockNumber(bestNumber.sub(bestNumberFinalized))
),
+2 -2
View File
@@ -25,12 +25,12 @@ import { HeaderAndValidators } from './subscribeNewHead';
export function getHeader (api: ApiInterface$Rx) {
return (hash: Uint8Array | string): Observable<HeaderExtended | undefined> =>
// tslint:disable-next-line
(combineLatest(
(combineLatest([
api.rpc.chain.getHeader(hash) as Observable<Header>,
api.query.session
? api.query.session.validators.at(hash)
: of([])
) as Observable<HeaderAndValidators>).pipe(
]) as Observable<HeaderAndValidators>).pipe(
map(([header, validators]) =>
new HeaderExtended(header, validators)
),
@@ -30,7 +30,7 @@ export function subscribeNewHead (api: ApiInterface$Rx) {
header && !!header.blockNumber
),
switchMap((header: Header): Observable<HeaderAndValidators> =>
(combineLatest(
(combineLatest([
of(header),
// theoretically we could combine at the first call with session.validators(), however
// we make 100% sure we actually get the validators at a specific block so when these
@@ -38,7 +38,7 @@ export function subscribeNewHead (api: ApiInterface$Rx) {
api.query.session
? api.query.session.validators.at(header.hash)
: of([])
) as Observable<HeaderAndValidators>)
]) as Observable<HeaderAndValidators>)
),
map(([header, validators]) =>
new HeaderExtended(header, validators)
@@ -17,11 +17,11 @@ export function referendumVotesFor (api: ApiInterface$Rx) {
return (referendumId: BN | number): Observable<Array<DerivedReferendumVote>> =>
(api.query.democracy.votersFor(referendumId) as Observable<Vector<AccountId>>).pipe(
switchMap((votersFor) =>
combineLatest(
combineLatest([
of(votersFor),
votes(api)(referendumId as BN, votersFor),
votingBalances(api)(votersFor)
)
])
),
map(([votersFor, votes, balances]) =>
votersFor.map((accountId, index): DerivedReferendumVote => ({
@@ -13,10 +13,10 @@ import { referendumInfos } from './referendumInfos';
export function referendums (api: ApiInterface$Rx) {
return (): Observable<Array<Option<ReferendumInfoExtended>>> =>
(combineLatest(
(combineLatest([
api.query.democracy.nextTally(),
api.query.democracy.referendumCount()
) as Observable<[ReferendumIndex?, ReferendumIndex?]>).pipe(
]) as Observable<[ReferendumIndex?, ReferendumIndex?]>).pipe(
switchMap(([nextTally, referendumCount]) =>
referendumCount && nextTally && referendumCount.gt(nextTally) && referendumCount.gtn(0)
? referendumInfos(api)(
+2 -2
View File
@@ -12,10 +12,10 @@ import { drr } from '../util/drr';
export function eraLength (api: ApiInterface$Rx) {
return (): Observable<BN> =>
(combineLatest(
(combineLatest([
api.query.session.sessionLength(),
api.query.staking.sessionsPerEra()
) as Observable<[BlockNumber?, BlockNumber?]>).pipe(
]) as Observable<[BlockNumber?, BlockNumber?]>).pipe(
map(
([sessionLength, sessionsPerEra]) =>
(sessionLength || new BN(1)).mul(sessionsPerEra || new BN(1))
@@ -13,13 +13,13 @@ import { drr } from '../util/drr';
export function eraProgress (api: ApiInterface$Rx) {
return (): Observable<BN> =>
(combineLatest(
(combineLatest([
sessionProgress(api)(),
api.query.session.currentIndex(),
api.query.session.sessionLength(),
api.query.staking.lastEraLengthChange(),
api.query.staking.sessionsPerEra()
) as Observable<[BN, BlockNumber?, BlockNumber?, BlockNumber?, BlockNumber?]>).pipe(
]) as Observable<[BN, BlockNumber?, BlockNumber?, BlockNumber?, BlockNumber?]>).pipe(
map(
([sessionProgress, currentIndex, sessionLength, lastEraLengthChange, sessionsPerEra]) =>
(currentIndex || new BN(0))
@@ -13,11 +13,11 @@ import { drr } from '../util/drr';
export function sessionProgress (api: ApiInterface$Rx) {
return (): Observable<BN> =>
combineLatest(
combineLatest([
bestNumber(api)(),
api.query.session.sessionLength(),
api.query.session.lastLengthChange()
).pipe(
]).pipe(
map(
([bestNumber, sessionLength, lastLengthChange]) =>
(bestNumber || new BN(0))
@@ -25,10 +25,10 @@ export function controllers (api: ApiInterface$Rx) {
(api.query.staking.validators() as any as Observable<[Array<AccountId>, any]>)
.pipe(
switchMap(([stashIds]) =>
combineLatest(
combineLatest([
of(stashIds),
allBonds(api, stashIds)
)
])
),
drr()
);