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
4 changes: 4 additions & 0 deletions src/components/SimulationResultsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ const SimulationResultsPage: React.FC<SimulationResultsPageProps> = (props) => {
const statusIcon = result.success ? "\u2713" : "\u2717";

const hash = id || Date.now().toString();
const isTxHashReplay = contractContext?.simulationOrigin === "tx-hash-replay";
const replayedHash = isTxHashReplay ? contractContext?.replayTxHash : undefined;
const refHash = replayedHash && replayedHash !== hash ? replayedHash : undefined;
const network = contractContext?.networkName || "Ethereum";
const blockNumber = result.blockNumber ? String(result.blockNumber) : "\u2014";

Expand Down Expand Up @@ -139,6 +142,7 @@ const SimulationResultsPage: React.FC<SimulationResultsPageProps> = (props) => {

<TransactionSummary
hash={hash}
refHash={refHash}
network={network}
statusColor={statusColor}
statusIcon={statusIcon}
Expand Down
9 changes: 7 additions & 2 deletions src/components/TopBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Suspense, useState, useEffect } from "react";
import { Link } from "react-router-dom";
import {
GearSix as SettingsIcon,
HardDrive,
Expand Down Expand Up @@ -61,7 +62,11 @@ const TopBar: React.FC<TopBarProps> = ({
className,
)}
>
<div className="flex shrink-0 items-center gap-2.5">
<Link
to="/"
aria-label="HexKit home"
className="flex shrink-0 items-center gap-2.5 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-primary/50"
>
<svg
viewBox="0 0 100 100"
fill="none"
Expand Down Expand Up @@ -165,7 +170,7 @@ const TopBar: React.FC<TopBarProps> = ({
>
HEXKIT
</span>
</div>
</Link>

<div className="pointer-events-none absolute inset-0 hidden md:flex items-center justify-center px-2">
<UniversalSearchBar
Expand Down
13 changes: 13 additions & 0 deletions src/components/simulation-results/TransactionSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { useNativeTokenPrice } from "../../hooks/useNativeTokenPrice";

interface TransactionSummaryProps {
hash: string;
/** Original on-chain transaction hash when this simulation is a tx-hash replay. */
refHash?: string;
network: string;
statusColor: string;
statusIcon: string;
Expand All @@ -34,6 +36,7 @@ interface TransactionSummaryProps {

export const TransactionSummary: React.FC<TransactionSummaryProps> = ({
hash,
refHash,
network,
statusColor,
statusIcon,
Expand Down Expand Up @@ -121,6 +124,16 @@ export const TransactionSummary: React.FC<TransactionSummaryProps> = ({
</div>
</div>

{refHash && (
<div className="sim-summary-row">
<span className="sim-summary-label">Ref Hash</span>
<div className="sim-summary-value">
<span className="sim-summary-mono">{refHash}</span>
<CopyButton value={refHash} className="sim-copy-btn" iconSize={12} />
</div>
</div>
)}

<div className="sim-summary-row">
<span className="sim-summary-label">Network</span>
<span className="sim-summary-value">
Expand Down
Loading