Skip to content

Commit

Permalink
Rejected pre-chain txs
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovalov committed May 6, 2024
1 parent eb17e74 commit 70f5fbb
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions ui/tx/details/TxInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => {
</Tooltip>
) : null;

const getTxStatus = () => {
if (!data.block && data.error) {
return 'error';
} else {
return data.status;
}
};

return (
<Grid columnGap={ 8 } rowGap={{ base: 3, lg: 3 }} templateColumns={{ base: 'minmax(0, 1fr)', lg: 'max-content minmax(728px, auto)' }}>

Expand All @@ -132,7 +140,7 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => {
flexWrap="nowrap"
isLoading={ isLoading }
>
{ data.status === null && <Spinner mr={ 2 } size="sm" flexShrink={ 0 }/> }
{ (data.status === null && !data.error) && <Spinner mr={ 2 } size="sm" flexShrink={ 0 }/> }
<Skeleton isLoaded={ !isLoading } overflow="hidden">
<HashStringShortenDynamic hash={ data.hash }/>
</Skeleton>
Expand All @@ -154,7 +162,7 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => {
hint="Current transaction state: Success, Failed (Error), or Pending (In Process)"
isLoading={ isLoading }
>
<TxStatus status={ data.status } errorText={ data.status === 'error' ? data.result : undefined } isLoading={ isLoading }/>
<TxStatus status={ getTxStatus() } errorText={ data.status === 'error' ? data.result : undefined } isLoading={ isLoading }/>
{ data.method && (
<Tag colorScheme={ data.method === 'Multicall' ? 'teal' : 'gray' } isLoading={ isLoading } isTruncated ml={ 3 }>
{ data.method }
Expand Down Expand Up @@ -199,6 +207,14 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => {
<TxRevertReason { ...data.revert_reason }/>
</DetailsInfoItem>
) }
{ !data.block && data.error && (
<DetailsInfoItem
title="Revert reason"
hint="The revert reason of the transaction"
>
<TxRevertReason raw={ data.error }/>
</DetailsInfoItem>
) }
{ data.zksync && (
<DetailsInfoItem
title="L1 status"
Expand Down

0 comments on commit 70f5fbb

Please sign in to comment.