todo chainhead follow

This commit is contained in:
Carlo Sala
2024-11-09 18:50:02 +07:00
parent 6b5d15eba4
commit 2cf80a9e4a

View File

@@ -4,10 +4,7 @@ import {
PinnedBlocks,
SystemEvent,
} from "@polkadot-api/observable-client"
import {
FollowEventWithRuntime,
StopError,
} from "@polkadot-api/substrate-client"
import { StopError } from "@polkadot-api/substrate-client"
import { state, withDefault } from "@react-rxjs/core"
import { partitionByKey, toKeySet } from "@react-rxjs/utils"
import { HexString } from "polkadot-api"
@@ -26,6 +23,7 @@ import {
mergeMap,
NEVER,
Observable,
ObservedValueOf,
of,
repeat,
retry,
@@ -277,7 +275,7 @@ export const blocksByHeight$ = state(
)
function withInitializedNumber() {
return (source$: Observable<FollowEventWithRuntime>) =>
return (source$: Observable<ObservedValueOf<ChainHead$["follow$"]>>) =>
source$.pipe(
withLatestFrom(chainHead$),
concatMap(([event, chainHead]) => {