Commit d423fb88 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Merge pull request #1680 from blockscout/tom2drum/issue-1674

Handle undefined timestamp for zkEVM batch
parents a5a42116 b3f5a0b5
...@@ -5,7 +5,7 @@ export type ZkEvmL2TxnBatchesItem = { ...@@ -5,7 +5,7 @@ export type ZkEvmL2TxnBatchesItem = {
verify_tx_hash: string | null; verify_tx_hash: string | null;
sequence_tx_hash: string | null; sequence_tx_hash: string | null;
status: string; status: string;
timestamp: string; timestamp: string | null;
tx_count: number; tx_count: number;
} }
...@@ -26,7 +26,7 @@ export type ZkEvmL2TxnBatch = { ...@@ -26,7 +26,7 @@ export type ZkEvmL2TxnBatch = {
sequence_tx_hash: string; sequence_tx_hash: string;
state_root: string; state_root: string;
status: typeof ZKEVM_L2_TX_BATCH_STATUSES[number]; status: typeof ZKEVM_L2_TX_BATCH_STATUSES[number];
timestamp: string; timestamp: string | null;
transactions: Array<string>; transactions: Array<string>;
verify_tx_hash: string; verify_tx_hash: string;
} }
......
...@@ -86,7 +86,7 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => { ...@@ -86,7 +86,7 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => {
title="Timestamp" title="Timestamp"
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
> >
<DetailsTimestamp timestamp={ data.timestamp } isLoading={ isPlaceholderData }/> { data.timestamp ? <DetailsTimestamp timestamp={ data.timestamp } isLoading={ isPlaceholderData }/> : 'Undefined' }
</DetailsInfoItem> </DetailsInfoItem>
<DetailsInfoItem <DetailsInfoItem
title="Verify tx hash" title="Verify tx hash"
...@@ -98,7 +98,7 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => { ...@@ -98,7 +98,7 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => {
hash={ data.verify_tx_hash } hash={ data.verify_tx_hash }
maxW="100%" maxW="100%"
/> />
) : <Text>pending</Text> } ) : <Text>Pending</Text> }
</DetailsInfoItem> </DetailsInfoItem>
<DetailsInfoItem <DetailsInfoItem
title="Transactions" title="Transactions"
......
...@@ -18,7 +18,7 @@ const rollupFeature = config.features.rollup; ...@@ -18,7 +18,7 @@ const rollupFeature = config.features.rollup;
type Props = { item: ZkEvmL2TxnBatchesItem; isLoading?: boolean }; type Props = { item: ZkEvmL2TxnBatchesItem; isLoading?: boolean };
const ZkEvmTxnBatchesListItem = ({ item, isLoading }: Props) => { const ZkEvmTxnBatchesListItem = ({ item, isLoading }: Props) => {
const timeAgo = dayjs(item.timestamp).fromNow(); const timeAgo = item.timestamp ? dayjs(item.timestamp).fromNow() : 'Undefined';
if (!rollupFeature.isEnabled || rollupFeature.type !== 'zkEvm') { if (!rollupFeature.isEnabled || rollupFeature.type !== 'zkEvm') {
return null; return null;
......
...@@ -17,7 +17,7 @@ const rollupFeature = config.features.rollup; ...@@ -17,7 +17,7 @@ const rollupFeature = config.features.rollup;
type Props = { item: ZkEvmL2TxnBatchesItem; isLoading?: boolean }; type Props = { item: ZkEvmL2TxnBatchesItem; isLoading?: boolean };
const TxnBatchesTableItem = ({ item, isLoading }: Props) => { const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
const timeAgo = dayjs(item.timestamp).fromNow(); const timeAgo = item.timestamp ? dayjs(item.timestamp).fromNow() : 'Undefined';
if (!rollupFeature.isEnabled || rollupFeature.type !== 'zkEvm') { if (!rollupFeature.isEnabled || rollupFeature.type !== 'zkEvm') {
return null; return null;
......
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