Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mailbox to Tenderly card #55

Merged
merged 1 commit into from
Nov 18, 2023
Merged
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
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