diff --git a/app/components/block/BlockHistoryCard.tsx b/app/components/block/BlockHistoryCard.tsx index 366936b74..04e2d0564 100755 --- a/app/components/block/BlockHistoryCard.tsx +++ b/app/components/block/BlockHistoryCard.tsx @@ -118,7 +118,7 @@ export function BlockHistoryCard({ block, epoch }: { block: VersionedBlockRespon let costUnits: number | undefined = undefined; try { - costUnits = tx.meta?.costUnits ?? 0; + costUnits = tx.meta?.costUnits; } catch (err) { // ignore parsing errors because some old logs aren't parsable } @@ -172,7 +172,7 @@ export function BlockHistoryCard({ block, epoch }: { block: VersionedBlockRespon if (sortMode === 'compute' && showComputeUnits) { filteredTxs.sort((a, b) => b.computeUnits! - a.computeUnits!); } else if (sortMode === 'txnCost') { - filteredTxs.sort((a, b) => b.costUnits! - a.costUnits!); + filteredTxs.sort((a, b) => (b.costUnits ?? 0) - (a.costUnits ?? 0)); } else if (sortMode === 'fee') { filteredTxs.sort((a, b) => (b.meta?.fee || 0) - (a.meta?.fee || 0)); } else if (sortMode === 'reservedCUs') { @@ -345,7 +345,7 @@ export function BlockHistoryCard({ block, epoch }: { block: VersionedBlockRespon {tx.costUnits !== undefined ? new Intl.NumberFormat('en-US').format(tx.costUnits) - : 'Unknown'} + : 'Not Supported Slot'} {tx.invocations.size === 0 diff --git a/app/tx/[signature]/page-client.tsx b/app/tx/[signature]/page-client.tsx index c33f3d151..553ba27fd 100644 --- a/app/tx/[signature]/page-client.tsx +++ b/app/tx/[signature]/page-client.tsx @@ -346,12 +346,12 @@ function StatusCard({ signature, autoRefresh }: SignatureProps & AutoRefreshProp )} - {costUnits !== undefined && ( - - Transaction cost - {costUnits.toLocaleString('en-US')} - - )} + + Transaction cost + + {costUnits !== undefined ? costUnits.toLocaleString('en-US') : 'Not Supported Slot'} + + {reservedCUs !== undefined && (