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
feat: expose wallet.registerContractClass (prep for simulating contract upgrades) (#22932)
Adds `wallet.registerContractClass(artifact)` (a thin pass-through to
PXE) so external callers can register a new class artifact locally
before passing an instance override (next pr) that targets it. Without
this, PXE-side ACIR dispatch can't resolve private functions of the
override's class.
`ContractClassesCapability` gains a `canRegister?: boolean` flag so
wallets can grant or deny the new method via the capability manifest,
matching the existing `ContractsCapability.canRegister` pattern.
With `fastForwardContractUpdate` (next pr in stack) plus this method, a
single `.simulate({ overrides })` covers both private and public
function calls on an upgraded contract:
```typescript
await wallet.registerContractClass(UpdatedContract.artifact);
// and then upcoming work:
const overrides = await fastForwardContractUpdate({ instanceAddress, newClassId, node });
await updatedContract.methods.set_private_value().simulate({ from, overrides });
```
0 commit comments