From aae12131d470e2c268c6db7e3051a0398f34f393 Mon Sep 17 00:00:00 2001 From: dafuga Date: Wed, 2 Oct 2024 12:15:48 -0700 Subject: [PATCH] fix: fixing type errors --- .../msig/[proposer]/[proposal]/+page.svelte | 10 +++-- .../[network]/(explorer)/network/+page.svelte | 4 +- .../transaction/[id]/[[seq]]/+page.svelte | 44 +++++++++++++++---- .../[id]/[[seq]]/data/+page.svelte | 3 +- 4 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/routes/[network]/(explorer)/msig/[proposer]/[proposal]/+page.svelte b/src/routes/[network]/(explorer)/msig/[proposer]/[proposal]/+page.svelte index 84627052a..f4706bc9f 100644 --- a/src/routes/[network]/(explorer)/msig/[proposer]/[proposal]/+page.svelte +++ b/src/routes/[network]/(explorer)/msig/[proposer]/[proposal]/+page.svelte @@ -1,12 +1,16 @@ -

{data.proposer}/{data.name}

+ + + diff --git a/src/routes/[network]/(explorer)/network/+page.svelte b/src/routes/[network]/(explorer)/network/+page.svelte index 139679edc..f2ee704ef 100644 --- a/src/routes/[network]/(explorer)/network/+page.svelte +++ b/src/routes/[network]/(explorer)/network/+page.svelte @@ -1,6 +1,4 @@ {#if data.transaction && data.transaction.trx} - {#each data.transaction.trx.trx.actions as action} - {@const summaryComponent = summaryMap[action.account][action.name]} - {#if summaryComponent} - + {@const actions = data.transaction.trx.trx.actions as Action[]} + {#each actions as action} + {#if isValidAccount(action.account)} + {@const accountMap = summaryMap[action.account]} + {#if isValidActionName(action.account, action.name)} + {@const summaryComponent = accountMap[action.name]} + + {:else} +

Unknown action: {action.account}::{action.name}

+ {/if} {:else} -

Unknown action: {action.account}::{action.name}

+

Unknown account: {action.account}

{/if} {JSON.stringify(action, null, 2)} {/each} @@ -40,7 +68,7 @@ {#if data.seq} {@const trace = data.transaction.traces.find( - (t) => String(t.receipt.global_sequence) === data.seq + (t: { receipt: { global_sequence: number } }) => String(t.receipt.global_sequence) === data.seq )} {JSON.stringify(trace, null, 2)} {:else} diff --git a/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/data/+page.svelte b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/data/+page.svelte index b29169907..3c84ecf2b 100644 --- a/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/data/+page.svelte +++ b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/data/+page.svelte @@ -1,6 +1,5 @@