Skip to content

Commit

Permalink
Fix block txCount (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon authored Sep 4, 2024
1 parent 378b7ca commit 8946aa3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/Blocks/BlockCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 7 additions & 2 deletions src/components/Blocks/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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' }),
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -146,7 +151,7 @@ export const BlockDetail = ({ block }: { block: IChainBlockInfoResponse }) => {
<DetailsTab block={block} />
</TabPanel>
<TabPanel>
<PaginatedBlockTransactionsList blockHeight={height} totalTxs={block.data.txs.length} />
<PaginatedBlockTransactionsList blockHeight={height} totalTxs={txCount} />
</TabPanel>
<TabPanel>
<RawContentBox obj={block} />
Expand Down

2 comments on commit 8946aa3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.