From 8946aa38308800676487e11abbf5e7b804efe981 Mon Sep 17 00:00:00 2001 From: selankon Date: Wed, 4 Sep 2024 05:49:20 -0500 Subject: [PATCH] Fix block txCount (#103) --- src/components/Blocks/BlockCard.tsx | 4 +++- src/components/Blocks/Detail.tsx | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/Blocks/BlockCard.tsx b/src/components/Blocks/BlockCard.tsx index 9840a40..e07487b 100644 --- a/src/components/Blocks/BlockCard.tsx +++ b/src/components/Blocks/BlockCard.tsx @@ -23,7 +23,9 @@ export const BlockCard = ({ block, compact = false }: IBlockCardProps) => { const height = block.header.height const time = block.header.time const proposer = block.header.proposerAddress - const txn = block.data.txs.length + // Not on the SDK yet + // @ts-ignore + const txn = block.txCount const date = new Date(time) diff --git a/src/components/Blocks/Detail.tsx b/src/components/Blocks/Detail.tsx index 61ab81b..3f5c63b 100644 --- a/src/components/Blocks/Detail.tsx +++ b/src/components/Blocks/Detail.tsx @@ -67,7 +67,9 @@ const DetailsTab = ({ block }: { block: IChainBlockInfoResponse }) => { }, { label: t('blocks.transactions', { defaultValue: 'Transactions' }), - children: block.data.txs.length, + // Not on the SDK yet + // @ts-ignore + children: block.txCount, }, { label: t('blocks.hash', { defaultValue: 'Hash' }), @@ -114,6 +116,9 @@ const DetailsTab = ({ block }: { block: IChainBlockInfoResponse }) => { export const BlockDetail = ({ block }: { block: IChainBlockInfoResponse }) => { const height = block.header.height const date = new Date(block.header.time) + // Not on the SDK yet + // @ts-ignore + const txCount = block.txCount const { formatDistance } = useDateFns() @@ -146,7 +151,7 @@ export const BlockDetail = ({ block }: { block: IChainBlockInfoResponse }) => { - +