transactions_count for Scroll batch could be null

This commit is contained in:
tom
2025-04-23 15:22:04 +02:00
parent 6401c84ddc
commit f82ee91e3f
4 changed files with 39 additions and 29 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ export type ScrollL2TxnBatch = {
confirmation_transaction: ScrollL2TxnBatchConfirmationTransaction;
start_block: number;
end_block: number;
transaction_count: number;
transaction_count: number | null;
data_availability: {
batch_data_container: 'in_blob4844' | 'in_calldata';
};
@@ -115,17 +115,21 @@ const ScrollL2TxnBatchDetails = ({ query }: Props) => {
}
</DetailedInfo.ItemValue>
<DetailedInfo.ItemLabel
isLoading={ isPlaceholderData }
hint="Number of transactions in this batch"
>
Transactions
</DetailedInfo.ItemLabel>
<DetailedInfo.ItemValue>
<Link loading={ isPlaceholderData } href={ route({ pathname: '/batches/[number]', query: { number: data.number.toString(), tab: 'txs' } }) }>
{ data.transaction_count.toLocaleString() } transaction{ data.transaction_count === 1 ? '' : 's' }
</Link>
</DetailedInfo.ItemValue>
{ typeof data.transaction_count === 'number' ? (
<>
<DetailedInfo.ItemLabel
isLoading={ isPlaceholderData }
hint="Number of transactions in this batch"
>
Transactions
</DetailedInfo.ItemLabel>
<DetailedInfo.ItemValue>
<Link loading={ isPlaceholderData } href={ route({ pathname: '/batches/[number]', query: { number: data.number.toString(), tab: 'txs' } }) }>
{ data.transaction_count.toLocaleString() } transaction{ data.transaction_count === 1 ? '' : 's' }
</Link>
</DetailedInfo.ItemValue>
</>
) : null }
<DetailedInfo.ItemLabel
isLoading={ isPlaceholderData }
@@ -104,17 +104,21 @@ const ScrollL2TxnBatchesListItem = ({ item, isLoading }: Props) => {
</Link>
</ListItemMobileGrid.Value>
<ListItemMobileGrid.Label isLoading={ isLoading }>Txn count</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value>
<Link
href={ route({ pathname: '/batches/[number]', query: { number: item.number.toString(), tab: 'txs' } }) }
loading={ isLoading }
fontWeight={ 600 }
minW="40px"
>
{ item.transaction_count.toLocaleString() }
</Link>
</ListItemMobileGrid.Value>
{ typeof item.transaction_count === 'number' ? (
<>
<ListItemMobileGrid.Label isLoading={ isLoading }>Txn count</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value>
<Link
href={ route({ pathname: '/batches/[number]', query: { number: item.number.toString(), tab: 'txs' } }) }
loading={ isLoading }
fontWeight={ 600 }
minW="40px"
>
{ item.transaction_count.toLocaleString() }
</Link>
</ListItemMobileGrid.Value>
</>
) : null }
</ListItemMobileGrid.Container>
);
@@ -87,12 +87,14 @@ const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
</Link>
</TableCell>
<TableCell verticalAlign="middle" isNumeric>
<Link
href={ route({ pathname: '/batches/[number]', query: { number: item.number.toString(), tab: 'txs' } }) }
loading={ isLoading }
>
{ item.transaction_count.toLocaleString() }
</Link>
{ typeof item.transaction_count === 'number' ? (
<Link
href={ route({ pathname: '/batches/[number]', query: { number: item.number.toString(), tab: 'txs' } }) }
loading={ isLoading }
>
{ item.transaction_count.toLocaleString() }
</Link>
) : 'N/A' }
</TableCell>
</TableRow>
);