fix: block author not loading when aura preRuntime digest is not in the first position

This commit is contained in:
Victor Oliva
2025-11-19 11:48:05 +01:00
parent 2f67e1b174
commit 595e465fdd
2 changed files with 17 additions and 6 deletions
+14 -3
View File
@@ -16,13 +16,14 @@ import { FC, useEffect } from "react"
import {
catchError,
combineLatest,
filter,
from,
map,
Observable,
switchMap,
take,
} from "rxjs"
import { blockInfo$, BlockState, finalized$ } from "../block.state"
import { blockInfoState$, BlockState, finalized$ } from "../block.state"
const validatorCache: WeakMap<
PolkadotClient,
@@ -56,7 +57,10 @@ const validators$ = state(
switchMap((client) =>
combineLatest([
fetchCachedValidators$(client, block),
blockInfo$(block).pipe(map((v) => v.status)),
blockInfoState$(block).pipe(
filter((v) => v != null),
map((v) => v?.status),
),
]).pipe(
map(([{ idx, validators }, blockStatus]) => {
if (
@@ -123,7 +127,14 @@ const BabePreDigest = Variant({
})
const getAuthorityIdx = (header: BlockHeader) => {
const preRuntime = header.digests.find((d) => d.type === "preRuntime")?.value
const preRuntime = header.digests.find(
(d) => d.type === "preRuntime" && ["BABE", "aura"].includes(d.value.engine),
)?.value as
| {
engine: string
payload: HexString
}
| undefined
switch (preRuntime?.engine) {
case "BABE": {
+3 -3
View File
@@ -120,7 +120,7 @@ const NetworkSwitchDialogContent: FC<{
return (
<DialogContent
className="sm:max-w-[425px] min-h-[450px] max-h-full flex flex-col w-auto"
className="sm:max-w-[425px] sm:min-w-[425px] min-h-[450px] max-h-full flex flex-col w-auto"
onEscapeKeyDown={(evt) => {
if (
evt.target instanceof HTMLElement &&
@@ -198,7 +198,7 @@ const NetworkSwitchDialogContent: FC<{
</CommandPopover>
<div className="h-[50vh] flex flex-col gap-2">
{selectedNetwork ? (
<div className="grow-1 overflow-hidden flex flex-col">
<div className="grow overflow-hidden flex flex-col">
<p className="py-2">Network: {selectedNetwork.display}</p>
<div className="overflow-auto">
<RadioGroup
@@ -281,7 +281,7 @@ const ConnectionOption: FC<{
>
<div className="flex items-start space-x-2">
<RadioGroupItem value={value} id={`chain-${value}`} className="mt-1" />
<div className="grid gap-0.5 flex-grow">
<div className="grid gap-0.5 grow">
<Label htmlFor={`chain-${value}`} className="font-medium">
{name}
{type === "light" ? (