Skip to content

Commit

Permalink
Merge branch 'main' into metadata-parsing-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrossy committed Dec 19, 2023
2 parents 07094a1 + b0f2a4a commit 9b7d865
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/features/debugger/debugMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async function debugMessageDelivery(
senderBytes,
body,
]);
const calldataDetails = { handleCalldata, contract: recipient };
const calldataDetails = { handleCalldata, contract: recipient, mailbox: destMailbox };
try {
// TODO add special case for Arbitrum:
// TODO account for mailbox handling gas overhead
Expand Down
1 change: 1 addition & 0 deletions src/features/debugger/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface MessageDebugResult {
calldataDetails?: {
handleCalldata: HexString;
contract: Address;
mailbox: Address;
};
}

Expand Down
13 changes: 9 additions & 4 deletions src/features/messages/cards/TransactionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function DeliveryStatus({ children }: PropsWithChildren<unknown>) {
function CallDataModal({ debugResult }: { debugResult?: MessageDebugResult }) {
const [isOpen, setIsOpen] = useState(false);
if (!debugResult?.calldataDetails) return null;
const { contract, handleCalldata } = debugResult.calldataDetails;
const { contract, handleCalldata, mailbox } = debugResult.calldataDetails;
return (
<>
<button onClick={() => setIsOpen(true)} className={`mt-5 ${styles.textLink}`}>
Expand All @@ -268,7 +268,7 @@ function CallDataModal({ debugResult }: { debugResult?: MessageDebugResult }) {
>
<div className="mt-2 flex flex-col space-y-3.5">
<p className="text-sm font-light">
{`The last step of message delivery is the recipient contract's 'handle' function. If the handle reverting, try debugging it with `}
{`The last step of message delivery is the recipient contract's 'handle' function. If the handle is reverting, try debugging it with `}
<a
className={`${styles.textLink} any:text-blue-500`}
href={links.tenderlySimDocs}
Expand All @@ -277,9 +277,14 @@ function CallDataModal({ debugResult }: { debugResult?: MessageDebugResult }) {
>
Tenderly.
</a>
{`You can simulate the call in Tenderly by setting the following values:`}
</p>
<LabelAndCodeBlock label="Recipient contract address:" value={contract} />
<LabelAndCodeBlock label="Handle function input calldata:" value={handleCalldata} />
<LabelAndCodeBlock label="From (Mailbox address):" value={mailbox} />
<LabelAndCodeBlock label="To (Recipient contract address):" value={contract} />
<LabelAndCodeBlock
label="Calldata (handle function input calldata):"
value={handleCalldata}
/>
</div>
</Modal>
</>
Expand Down

0 comments on commit 9b7d865

Please sign in to comment.