Commit 6095da71 authored by tom goriunov's avatar tom goriunov Committed by GitHub

L2 batches changes (#2313)

Fixes #2266
parent d701d044
...@@ -40,8 +40,8 @@ const TEMPLATE_MAP: Record<Route['pathname'], string> = { ...@@ -40,8 +40,8 @@ const TEMPLATE_MAP: Record<Route['pathname'], string> = {
'/deposits': '%network_name% deposits (L1 > L2)', '/deposits': '%network_name% deposits (L1 > L2)',
'/output-roots': '%network_name% output roots', '/output-roots': '%network_name% output roots',
'/dispute-games': '%network_name% dispute games', '/dispute-games': '%network_name% dispute games',
'/batches': '%network_name% tx batches (L2 blocks)', '/batches': '%network_name% txn batches',
'/batches/[number]': '%network_name% L2 tx batch %number%', '/batches/[number]': '%network_name% L2 txn batch %number%',
'/blobs/[hash]': '%network_name% blob %hash% details', '/blobs/[hash]': '%network_name% blob %hash% details',
'/ops': 'User operations on %network_name% - %network_name% explorer', '/ops': 'User operations on %network_name% - %network_name% explorer',
'/op/[hash]': '%network_name% user operation %hash%', '/op/[hash]': '%network_name% user operation %hash%',
......
...@@ -38,8 +38,8 @@ export const PAGE_TYPE_DICT: Record<Route['pathname'], string> = { ...@@ -38,8 +38,8 @@ export const PAGE_TYPE_DICT: Record<Route['pathname'], string> = {
'/deposits': 'Deposits (L1 > L2)', '/deposits': 'Deposits (L1 > L2)',
'/output-roots': 'Output roots', '/output-roots': 'Output roots',
'/dispute-games': 'Dispute games', '/dispute-games': 'Dispute games',
'/batches': 'Tx batches (L2 blocks)', '/batches': 'Txn batches',
'/batches/[number]': 'L2 tx batch details', '/batches/[number]': 'L2 txn batch details',
'/blobs/[hash]': 'Blob details', '/blobs/[hash]': 'Blob details',
'/ops': 'User operations', '/ops': 'User operations',
'/op/[hash]': 'User operation details', '/op/[hash]': 'User operation details',
......
...@@ -108,7 +108,7 @@ const ArbitrumL2TxnBatch = () => { ...@@ -108,7 +108,7 @@ const ArbitrumL2TxnBatch = () => {
} }
return { return {
label: 'Back to tx batches list', label: 'Back to txn batches list',
url: appProps.referrer, url: appProps.referrer,
}; };
}, [ appProps.referrer ]); }, [ appProps.referrer ]);
...@@ -117,7 +117,7 @@ const ArbitrumL2TxnBatch = () => { ...@@ -117,7 +117,7 @@ const ArbitrumL2TxnBatch = () => {
<> <>
<TextAd mb={ 6 }/> <TextAd mb={ 6 }/>
<PageTitle <PageTitle
title={ `Tx batch #${ number }` } title={ `Txn batch #${ number }` }
backLink={ backLink } backLink={ backLink }
/> />
{ batchQuery.isPlaceholderData ? { batchQuery.isPlaceholderData ?
......
...@@ -2,7 +2,6 @@ import { Hide, Show, Skeleton, Text } from '@chakra-ui/react'; ...@@ -2,7 +2,6 @@ import { Hide, Show, Skeleton, Text } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import useApiQuery from 'lib/api/useApiQuery'; import useApiQuery from 'lib/api/useApiQuery';
import { nbsp } from 'lib/html-entities';
import { ARBITRUM_L2_TXN_BATCHES_ITEM } from 'stubs/arbitrumL2'; import { ARBITRUM_L2_TXN_BATCHES_ITEM } from 'stubs/arbitrumL2';
import { generateListStub } from 'stubs/utils'; import { generateListStub } from 'stubs/utils';
import { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar'; import { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar';
...@@ -60,7 +59,7 @@ const ArbitrumL2TxnBatches = () => { ...@@ -60,7 +59,7 @@ const ArbitrumL2TxnBatches = () => {
return ( return (
<Skeleton isLoaded={ !countersQuery.isPlaceholderData && !isPlaceholderData } display="flex" flexWrap="wrap"> <Skeleton isLoaded={ !countersQuery.isPlaceholderData && !isPlaceholderData } display="flex" flexWrap="wrap">
Tx batch (L2 block) Txn batch
<Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[0].number } </Text>to <Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[0].number } </Text>to
<Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[data.items.length - 1].number } </Text> <Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[data.items.length - 1].number } </Text>
(total of { countersQuery.data?.toLocaleString() } batches) (total of { countersQuery.data?.toLocaleString() } batches)
...@@ -72,11 +71,11 @@ const ArbitrumL2TxnBatches = () => { ...@@ -72,11 +71,11 @@ const ArbitrumL2TxnBatches = () => {
return ( return (
<> <>
<PageTitle title={ `Tx batches (L2${ nbsp }blocks)` } withTextAd/> <PageTitle title="Txn batches" withTextAd/>
<DataListDisplay <DataListDisplay
isError={ isError } isError={ isError }
items={ data?.items } items={ data?.items }
emptyText="There are no tx batches." emptyText="There are no txn batches."
content={ content } content={ content }
actionBar={ actionBar } actionBar={ actionBar }
/> />
......
...@@ -106,7 +106,7 @@ const OptimisticL2TxnBatch = () => { ...@@ -106,7 +106,7 @@ const OptimisticL2TxnBatch = () => {
} }
return { return {
label: 'Back to tx batches list', label: 'Back to txn batches list',
url: appProps.referrer, url: appProps.referrer,
}; };
}, [ appProps.referrer ]); }, [ appProps.referrer ]);
......
...@@ -2,7 +2,6 @@ import { Hide, Show, Skeleton, Text } from '@chakra-ui/react'; ...@@ -2,7 +2,6 @@ import { Hide, Show, Skeleton, Text } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import useApiQuery from 'lib/api/useApiQuery'; import useApiQuery from 'lib/api/useApiQuery';
import { nbsp } from 'lib/html-entities';
import { L2_TXN_BATCHES_ITEM } from 'stubs/L2'; import { L2_TXN_BATCHES_ITEM } from 'stubs/L2';
import { generateListStub } from 'stubs/utils'; import { generateListStub } from 'stubs/utils';
import { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar'; import { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar';
...@@ -60,7 +59,7 @@ const OptimisticL2TxnBatches = () => { ...@@ -60,7 +59,7 @@ const OptimisticL2TxnBatches = () => {
return ( return (
<Skeleton isLoaded={ !countersQuery.isPlaceholderData && !isPlaceholderData } display="flex" flexWrap="wrap"> <Skeleton isLoaded={ !countersQuery.isPlaceholderData && !isPlaceholderData } display="flex" flexWrap="wrap">
Tx batch (L2 block) Txn batch
<Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[0].internal_id } </Text>to <Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[0].internal_id } </Text>to
<Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[data.items.length - 1].internal_id } </Text> <Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[data.items.length - 1].internal_id } </Text>
(total of { countersQuery.data?.toLocaleString() } batches) (total of { countersQuery.data?.toLocaleString() } batches)
...@@ -72,11 +71,11 @@ const OptimisticL2TxnBatches = () => { ...@@ -72,11 +71,11 @@ const OptimisticL2TxnBatches = () => {
return ( return (
<> <>
<PageTitle title={ `Tx batches (L2${ nbsp }blocks)` } withTextAd/> <PageTitle title="Txn batches" withTextAd/>
<DataListDisplay <DataListDisplay
isError={ isError } isError={ isError }
items={ data?.items } items={ data?.items }
emptyText="There are no tx batches." emptyText="There are no txn batches."
content={ content } content={ content }
actionBar={ actionBar } actionBar={ actionBar }
/> />
......
...@@ -59,7 +59,7 @@ const ZkEvmL2TxnBatch = () => { ...@@ -59,7 +59,7 @@ const ZkEvmL2TxnBatch = () => {
} }
return { return {
label: 'Back to tx batches list', label: 'Back to txn batches list',
url: appProps.referrer, url: appProps.referrer,
}; };
}, [ appProps.referrer ]); }, [ appProps.referrer ]);
...@@ -68,7 +68,7 @@ const ZkEvmL2TxnBatch = () => { ...@@ -68,7 +68,7 @@ const ZkEvmL2TxnBatch = () => {
<> <>
<TextAd mb={ 6 }/> <TextAd mb={ 6 }/>
<PageTitle <PageTitle
title={ `Tx batch #${ number }` } title={ `Txn batch #${ number }` }
backLink={ backLink } backLink={ backLink }
/> />
{ batchQuery.isPlaceholderData ? <TabsSkeleton tabs={ tabs }/> : ( { batchQuery.isPlaceholderData ? <TabsSkeleton tabs={ tabs }/> : (
......
...@@ -59,7 +59,7 @@ const ZkEvmL2TxnBatches = () => { ...@@ -59,7 +59,7 @@ const ZkEvmL2TxnBatches = () => {
return ( return (
<Skeleton isLoaded={ !countersQuery.isPlaceholderData && !isPlaceholderData } display="flex" flexWrap="wrap"> <Skeleton isLoaded={ !countersQuery.isPlaceholderData && !isPlaceholderData } display="flex" flexWrap="wrap">
Tx batch Txn batch
<Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[0].number } </Text>to <Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[0].number } </Text>to
<Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[data.items.length - 1].number } </Text> <Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[data.items.length - 1].number } </Text>
(total of { countersQuery.data?.toLocaleString() } batches) (total of { countersQuery.data?.toLocaleString() } batches)
...@@ -71,11 +71,11 @@ const ZkEvmL2TxnBatches = () => { ...@@ -71,11 +71,11 @@ const ZkEvmL2TxnBatches = () => {
return ( return (
<> <>
<PageTitle title="Tx batches" withTextAd/> <PageTitle title="Txn batches" withTextAd/>
<DataListDisplay <DataListDisplay
isError={ isError } isError={ isError }
items={ data?.items } items={ data?.items }
emptyText="There are no tx batches." emptyText="There are no txn batches."
content={ content } content={ content }
actionBar={ actionBar } actionBar={ actionBar }
/> />
......
...@@ -80,7 +80,7 @@ const ZkSyncL2TxnBatch = () => { ...@@ -80,7 +80,7 @@ const ZkSyncL2TxnBatch = () => {
} }
return { return {
label: 'Back to tx batches list', label: 'Back to txn batches list',
url: appProps.referrer, url: appProps.referrer,
}; };
}, [ appProps.referrer ]); }, [ appProps.referrer ]);
...@@ -89,7 +89,7 @@ const ZkSyncL2TxnBatch = () => { ...@@ -89,7 +89,7 @@ const ZkSyncL2TxnBatch = () => {
<> <>
<TextAd mb={ 6 }/> <TextAd mb={ 6 }/>
<PageTitle <PageTitle
title={ `Tx batch #${ number }` } title={ `Txn batch #${ number }` }
backLink={ backLink } backLink={ backLink }
/> />
{ batchQuery.isPlaceholderData ? { batchQuery.isPlaceholderData ?
......
...@@ -59,7 +59,7 @@ const ZkSyncL2TxnBatches = () => { ...@@ -59,7 +59,7 @@ const ZkSyncL2TxnBatches = () => {
return ( return (
<Skeleton isLoaded={ !countersQuery.isPlaceholderData && !isPlaceholderData } display="flex" flexWrap="wrap"> <Skeleton isLoaded={ !countersQuery.isPlaceholderData && !isPlaceholderData } display="flex" flexWrap="wrap">
Tx batch Txn batch
<Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[0].number } </Text>to <Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[0].number } </Text>to
<Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[data.items.length - 1].number } </Text> <Text fontWeight={ 600 } whiteSpace="pre"> #{ data.items[data.items.length - 1].number } </Text>
(total of { countersQuery.data?.toLocaleString() } batches) (total of { countersQuery.data?.toLocaleString() } batches)
...@@ -71,11 +71,11 @@ const ZkSyncL2TxnBatches = () => { ...@@ -71,11 +71,11 @@ const ZkSyncL2TxnBatches = () => {
return ( return (
<> <>
<PageTitle title="Tx batches" withTextAd/> <PageTitle title="Txn batches" withTextAd/>
<DataListDisplay <DataListDisplay
isError={ isError } isError={ isError }
items={ data?.items } items={ data?.items }
emptyText="There are no tx batches." emptyText="There are no txn batches."
content={ content } content={ content }
actionBar={ actionBar } actionBar={ actionBar }
/> />
......
...@@ -306,7 +306,7 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => { ...@@ -306,7 +306,7 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => {
hint="Batch index for this transaction" hint="Batch index for this transaction"
isLoading={ isLoading } isLoading={ isLoading }
> >
Tx batch Txn batch
</DetailsInfoItem.Label> </DetailsInfoItem.Label>
<DetailsInfoItem.Value> <DetailsInfoItem.Value>
<BatchEntityL2 <BatchEntityL2
......
...@@ -77,7 +77,7 @@ const ArbitrumL2TxnBatchDetails = ({ query }: Props) => { ...@@ -77,7 +77,7 @@ const ArbitrumL2TxnBatchDetails = ({ query }: Props) => {
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
hint="Batch number indicates the length of batches produced by grouping L2 blocks to be proven on L1" hint="Batch number indicates the length of batches produced by grouping L2 blocks to be proven on L1"
> >
Tx batch number Txn batch number
</DetailsInfoItem.Label> </DetailsInfoItem.Label>
<DetailsInfoItem.Value> <DetailsInfoItem.Value>
<Skeleton isLoaded={ !isPlaceholderData }> <Skeleton isLoaded={ !isPlaceholderData }>
...@@ -86,8 +86,8 @@ const ArbitrumL2TxnBatchDetails = ({ query }: Props) => { ...@@ -86,8 +86,8 @@ const ArbitrumL2TxnBatchDetails = ({ query }: Props) => {
<PrevNext <PrevNext
ml={ 6 } ml={ 6 }
onClick={ handlePrevNextClick } onClick={ handlePrevNextClick }
prevLabel="View previous tx batch" prevLabel="View previous txn batch"
nextLabel="View next tx batch" nextLabel="View next txn batch"
isPrevDisabled={ data.number === 0 } isPrevDisabled={ data.number === 0 }
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
/> />
......
...@@ -47,7 +47,7 @@ const OptimisticL2TxnBatchBlobCelestia = ({ blobs, isLoading }: Props) => { ...@@ -47,7 +47,7 @@ const OptimisticL2TxnBatchBlobCelestia = ({ blobs, isLoading }: Props) => {
<Icon as={ celeniumIcon } boxSize={ 5 }/> <Icon as={ celeniumIcon } boxSize={ 5 }/>
<LinkExternal href={ getCeleniumUrl(blob) }>Blob page</LinkExternal> <LinkExternal href={ getCeleniumUrl(blob) }>Blob page</LinkExternal>
</GridItem> </GridItem>
<GridItem fontWeight={ 600 }>Hight</GridItem> <GridItem fontWeight={ 600 }>Height</GridItem>
<GridItem colSpan={ 2 }> <GridItem colSpan={ 2 }>
{ blob.height } { blob.height }
</GridItem> </GridItem>
......
...@@ -75,8 +75,8 @@ const OptimisticL2TxnBatchDetails = ({ query }: Props) => { ...@@ -75,8 +75,8 @@ const OptimisticL2TxnBatchDetails = ({ query }: Props) => {
<PrevNext <PrevNext
ml={ 6 } ml={ 6 }
onClick={ handlePrevNextClick } onClick={ handlePrevNextClick }
prevLabel="View previous tx batch" prevLabel="View previous txn batch"
nextLabel="View next tx batch" nextLabel="View next txn batch"
isPrevDisabled={ data.internal_id === 0 } isPrevDisabled={ data.internal_id === 0 }
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
/> />
......
...@@ -68,7 +68,7 @@ const OptimisticL2TxnBatchesListItem = ({ item, isLoading }: Props) => { ...@@ -68,7 +68,7 @@ const OptimisticL2TxnBatchesListItem = ({ item, isLoading }: Props) => {
</LinkInternal> </LinkInternal>
</ListItemMobileGrid.Value> </ListItemMobileGrid.Value>
<ListItemMobileGrid.Label isLoading={ isLoading }>L2 blocks</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Txn</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<LinkInternal <LinkInternal
href={ route({ pathname: '/batches/[number]', query: { number: item.internal_id.toString(), tab: 'txs' } }) } href={ route({ pathname: '/batches/[number]', query: { number: item.internal_id.toString(), tab: 'txs' } }) }
......
...@@ -64,7 +64,7 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => { ...@@ -64,7 +64,7 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => {
<DetailsInfoItem.Label <DetailsInfoItem.Label
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
> >
Tx batch number Txn batch number
</DetailsInfoItem.Label> </DetailsInfoItem.Label>
<DetailsInfoItem.Value> <DetailsInfoItem.Value>
<Skeleton isLoaded={ !isPlaceholderData }> <Skeleton isLoaded={ !isPlaceholderData }>
...@@ -73,8 +73,8 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => { ...@@ -73,8 +73,8 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => {
<PrevNext <PrevNext
ml={ 6 } ml={ 6 }
onClick={ handlePrevNextClick } onClick={ handlePrevNextClick }
prevLabel="View previous tx batch" prevLabel="View previous txn batch"
nextLabel="View next tx batch" nextLabel="View next txn batch"
isPrevDisabled={ data.number === 0 } isPrevDisabled={ data.number === 0 }
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
/> />
......
...@@ -80,7 +80,7 @@ const ZkSyncL2TxnBatchDetails = ({ query }: Props) => { ...@@ -80,7 +80,7 @@ const ZkSyncL2TxnBatchDetails = ({ query }: Props) => {
hint="Batch number indicates the length of batches produced by grouping L2 blocks to be proven on Ethereum." hint="Batch number indicates the length of batches produced by grouping L2 blocks to be proven on Ethereum."
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
> >
Tx batch number Txn batch number
</DetailsInfoItem.Label> </DetailsInfoItem.Label>
<DetailsInfoItem.Value> <DetailsInfoItem.Value>
<Skeleton isLoaded={ !isPlaceholderData }> <Skeleton isLoaded={ !isPlaceholderData }>
...@@ -89,8 +89,8 @@ const ZkSyncL2TxnBatchDetails = ({ query }: Props) => { ...@@ -89,8 +89,8 @@ const ZkSyncL2TxnBatchDetails = ({ query }: Props) => {
<PrevNext <PrevNext
ml={ 6 } ml={ 6 }
onClick={ handlePrevNextClick } onClick={ handlePrevNextClick }
prevLabel="View previous tx batch" prevLabel="View previous txn batch"
nextLabel="View next tx batch" nextLabel="View next txn batch"
isPrevDisabled={ data.number === 0 } isPrevDisabled={ data.number === 0 }
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
/> />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment