Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/components/block/BlockHistoryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -345,7 +345,7 @@ export function BlockHistoryCard({ block, epoch }: { block: VersionedBlockRespon
<td>
{tx.costUnits !== undefined
? new Intl.NumberFormat('en-US').format(tx.costUnits)
: 'Unknown'}
: 'Not Supported Slot'}
</td>
<td>
{tx.invocations.size === 0
Expand Down
12 changes: 6 additions & 6 deletions app/tx/[signature]/page-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,12 @@ function StatusCard({ signature, autoRefresh }: SignatureProps & AutoRefreshProp
</tr>
)}

{costUnits !== undefined && (
<tr>
<td>Transaction cost</td>
<td className="text-lg-end">{costUnits.toLocaleString('en-US')}</td>
</tr>
)}
<tr>
<td>Transaction cost</td>
<td className="text-lg-end">
{costUnits !== undefined ? costUnits.toLocaleString('en-US') : 'Not Supported Slot'}
</td>
</tr>

{reservedCUs !== undefined && (
<tr>
Expand Down