You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,29 @@ There are two independent test systems:
24
24
-**TypeScript E2E tests** (`yarn test:js`): Require a running local network.
25
25
-`yarn test` runs both. Ensure tests pass before committing.
26
26
27
+
## Simulate Before Send
28
+
29
+
**Always call `.simulate()` before `.send()` for every state-changing transaction.** Simulation runs the transaction locally and surfaces revert reasons immediately instead of waiting for the send timeout with an opaque error.
-**Wallet setup**: `EmbeddedWallet.create()` with `ephemeral: true` for tests; prover is enabled only on devnet.
106
106
-**PXE store**: Data persists in `./store`. Must delete after local network restart to avoid stale state errors.
107
107
108
+
## Simulate Before Send (IMPORTANT)
109
+
110
+
**Always call `.simulate()` before `.send()` for every state-changing transaction.** Simulation runs the transaction locally and surfaces revert reasons immediately. Without it, a failing transaction will hang until the send timeout (up to 600s) with an opaque error.
111
+
112
+
```typescript
113
+
// Simulate first — surfaces revert reasons instantly
Copy file name to clipboardExpand all lines: README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -185,6 +185,30 @@ The `./src/utils/` folder contains utility functions:
185
185
-`./src/utils/sponsored_fpc.ts` provides functions to deploy and manage the SponsoredFPC (Fee Payment Contract) for handling sponsored transaction fees.
186
186
-`./config/config.ts` provides environment-aware configuration loading, automatically selecting the correct JSON config file based on the `ENV` variable.
187
187
188
+
## Simulate Before Send
189
+
190
+
Always call `.simulate()` before `.send()` for every state-changing transaction. Simulation runs the transaction locally and surfaces revert reasons immediately. Without it, a failing transaction will hang until the send timeout with an opaque error.
191
+
192
+
```typescript
193
+
// Simulate first — surfaces revert reasons instantly
:warning: Tests and scripts set up and run the Private Execution Environment (PXE) and store PXE data in the `./store` directory. If you restart the local network, you will need to delete the `./store` directory to avoid errors.
0 commit comments