Skip to content

Commit

Permalink
add alt-svm sim warning
Browse files Browse the repository at this point in the history
simulations may fail on alt-SVM environments due to some accounts not being found
  • Loading branch information
joeymeere committed Nov 7, 2024
1 parent 1b24e7e commit 08144c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/(app)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ const AppLayout = async ({ children }: { children: React.ReactNode }) => {
<RenderMultisigRoute multisig={multisig} children={children} />
</div>
<Toaster
expand
visibleToasts={3}
icons={{
error: <AlertTriangle className="w-4 h-4 text-red-600" />,
success: <CheckSquare className="w-4 h-4 text-green-600" />,
Expand Down
14 changes: 9 additions & 5 deletions components/CreateTransactionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
Message,
PublicKey,
TransactionInstruction,
TransactionMessage,
clusterApiUrl,
} from "@solana/web3.js";
import { Input } from "./ui/input";
Expand Down Expand Up @@ -101,17 +100,22 @@ const CreateTransaction = ({
/>
<div className="flex gap-2 items-center justify-end">
<Button
onClick={() =>
onClick={() => {
toast("Note: Simulations may fail on alt-SVM", {
description: "Please verify via an explorer before submitting.",
});
toast.promise(
simulateEncodedTransaction(tx, connection, wallet),
{
id: "simulation",
loading: "Building simulation...",
success: "Simulation successful.",
error: (e) => `${e}`,
error: (e) => {
return `${e}`;
},
}
)
}
);
}}
>
Simulate
</Button>
Expand Down

0 comments on commit 08144c3

Please sign in to comment.