Commit da12a60
authored
fix(wallet-sdk): use derived contract address in registerContract (#24482)
## Problem
CI on `merge-train/fairies-v5` is red at the `yarn-project` build step
([ci.aztec-labs.com/1783026321562696](http://ci.aztec-labs.com/1783026321562696)).
The `compile_all` → `yarn tsgo -b --emitDeclarationOnly` typecheck fails
with:
```
wallet-sdk/src/base-wallet/base_wallet.ts(375,36): error TS2339: Property 'address' does not exist on type 'ContractInstancePreimage'.
wallet-sdk/src/base-wallet/base_wallet.ts(377,113): error TS2339: Property 'address' does not exist on type 'ContractInstancePreimage'.
```
These two were the complete set of errors reported by the
(non-fail-fast) tsgo pass.
## Root cause
This is a train-integration break, not a defect in the commit the CI run
is attributed to (#24480, which only touched a TXE registry type). On
the `v5-next` base, `ContractInstancePreimage` was refactored to no
longer store a derived `address` field (address is now computed from the
preimage; the with-address variant is the separate
`ContractInstancePreimageWithAddress`). The fairies train's rewrite of
`BaseWallet.registerContract` still read `instance.address`, which no
longer exists on that type.
## Fix
`PXE.registerContract(instance)` already returns the derived
`AztecAddress` (it computes
`computeContractAddressFromInstance(instance)` internally). Capture and
use that returned address for the account-mismatch assertion instead of
the removed `instance.address` field. This is semantically identical —
the returned value is exactly the address the field used to hold — and
touches only the two failing references.
## Verification
The workspace this fix was prepared in is a bare checkout with no
build/test cache available (no redis/docker) and insufficient free disk
for a from-scratch `bb` + `noir` + TS build, so a full local
`./bootstrap.sh ci-fast` could not be run to completion. The change is
verified by inspection against the type definitions and the
`PXE.registerContract` return contract; CI on this PR will exercise the
real build.
---
*Created by
[claudebox](https://claudebox.work/v2/sessions/8542372f24dbb848) ·
group: `slackbot`*1 parent 4057d0b commit da12a60
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
| 375 | + | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
0 commit comments