Skip to content

Commit 1b062ca

Browse files
committed
fix(wallets): pass contracts via options bag to SimulationOverrides
EmbeddedWallet was still calling the old positional-argument form of the SimulationOverrides constructor, so contract-instance overrides for the stub account were silently dropped, and simulation re-entered the real account entrypoint with no auth witness.
1 parent c199c88 commit 1b062ca

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

docs/docs-developers/docs/resources/migration_notes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ const result = await contract.methods.read_balance(account).simulate({
178178

179179
The same option flows through `wallet.simulateTx` and eventually to `simulatePublicCalls` RPC on `AztecNode`.
180180

181+
Direct callers of the `SimulationOverrides` constructor must switch from a positional `contracts` argument to an options bag:
182+
183+
```diff
184+
- new SimulationOverrides(contracts);
185+
+ new SimulationOverrides({ contracts });
186+
```
187+
181188
### [PXE] `proveTx` takes an options bag
182189

183190
`PXE.proveTx` used to accept `scopes` as a positional argument; it now takes an options bag consistent with `simulateTx` and `profileTx`, and adds an optional `senderForTags` field. Update direct callers:

yarn-project/wallets/src/embedded/embedded_wallet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export class EmbeddedWallet extends BaseWallet {
271271
const chainInfo = await this.getChainInfo();
272272

273273
const accountOverrides = await this.buildAccountOverrides(scopes);
274-
const overrides = new SimulationOverrides(accountOverrides);
274+
const overrides = new SimulationOverrides({ contracts: accountOverrides });
275275

276276
let txRequest: TxExecutionRequest;
277277
if (from === NO_FROM) {

0 commit comments

Comments
 (0)