Repository navigation
refactor(wallet): remove code that removed features left unused - #2032
Merged
Merged
Conversation
Retirements left symbols nothing calls: `maskAddress`, `getChainColor`, `readSendSlots`, `remapByMap`, `humanizeErrorKind`, `scopesEqual`, `OFFSCREEN_KEEPALIVE`, the restore-error field lists of the retired network and fpc slices, and the unused fields of the fee pricing record. The token seeder's version reader is now required, so its never-taken manifest fallback goes. The Send-picks parse tests read through the live reader, and the restore-error projection tests use a live service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extension preview build —
|
alejoamiras
added a commit
that referenced
this pull request
Nov 26, 2026
…entry (#2033) ## What changed The route snapshot half of #1976; the proving-backend half shipped in #1989. `RouteSnapshotSchema` existed twice, in `packages/aztec-runtime/src/pxe/schemas.ts` (the PXE client's parse) and in `apps/extension/src/wallet/services/network/spec.ts` (the network service's RPC result). Each value list was tied to its type by `as const satisfies readonly T[]`, which accepts a narrower list, so widening `EndpointState` or `TransportFailure` compiled while both copies refused the new value. #1989 could not import the schema from the `@nulo/aztec-runtime/pxe` barrel: the popup reaches `network/spec.ts`, and that import put the PXE and its kernel artifacts in the popup's graph. - **One home in a leaf entry.** `packages/aztec-runtime/src/pxe/route-snapshot.ts`, exported as `@nulo/aztec-runtime/pxe/route-snapshot`, holds the lists and the schema and imports only zod and types. `pxe/schemas.ts` re-exports it, so the client and its test keep their import. `network/spec.ts` imports it from the leaf, and its copy goes. Nothing imported the schema from `network/spec.ts`. - **The schema is unannotated**, so its inferred type is exact. `route-snapshot.test.ts` pins `z.output<typeof RouteSnapshotSchema>` to `RouteSnapshot | null` with `expectTypeOf`. A state or failure that only one side lists is now a compile error in `bun run typecheck:all`. - The comment at `network/spec.ts`'s type-only barrel import now says why values come from leaf entries. `packages/aztec-runtime/README.md` names the entry. ## Proofs - **Premise, at base `93394e1e7`.** With `EndpointState` widened by `"stale"`, `tsc --noEmit` in `packages/aztec-runtime` and `vue-tsc --noEmit` in `apps/extension` both exit 0, and both schemas refuse `state: "stale"` while accepting `"ready"`. - **Fix, at this head.** Widening `EndpointState` (`"stale"`) or `TransportFailure` (`"throttled"`) makes aztec-runtime's `tsc --noEmit` fail at `route-snapshot.test.ts` (TS2344). Unwidened, it passes. At run time, `pxe/schemas.ts`'s export and `NetworkMethodSchemas.getRouteSnapshot.result` are the leaf's schema object. - **The popup's graph does not grow.** Measured on the Chrome build: the module scripts in `dist/chrome/src/popup/index.html`, and the bytes of their files. | | module scripts | bytes | |---|---|---| | base `93394e1e7` | 177 | 4,017,361 | | head | 177 | 4,017,559 | The chunk names are the same, content hashes aside, except for one shared chunk, now named `route-snapshot` instead of `rpc-url`. - **Stored shapes.** The route snapshot is not a stored shape. `stored-shapes/snapshot.test.ts` passes with no new stamp. - **Layering.** Extension → aztec-runtime is allowed by `biome.json`'s `noRestrictedImports`. The leaf imports nothing from another workspace. - **Review.** One Codex pass (`gpt-6.1-sol`, high, read-only) over the diff. It was asked whether the popup's graph grows, whether a schema accepts or refuses anything new, whether a layer is crossed and whether the type test can pass vacuously. Verdict: approve, no findings. It compared both base schemas with the head schema on 27 boundary cases, and they agreed on every one. ## Validation At this head, `81556e22a` (rebased on `dev` after #2032), retry 0, one at a time: `bun run lint`, `bun run typecheck:all`, `bun run test` (1067 files passed), `bun run test:ci-gating` (784 pass). Before the rebase, at the same change: both Chrome builds above and `bun run --cwd apps/extension build-storybook`, all exit 0. No local e2e, since no behaviour changes. The e2e lanes in CI are the gate of record. No visible change. Closes #1976 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Retirements and moves left symbols that nothing calls. The reference sweep was re-run on
devat93394e1e7(the whole tree:scripts/, e2e helpers and fixtures, stories, the landing and playground,vi.mockfactories, string lookups); each item below had no production reference.maskAddress(components/composite/send/masked-address.ts, the file goes),getChainColor(components/ui/utils.ts),readSendSlots(utils/fee-picks.ts),remapByMap(utils/full-backup-helpers.ts),humanizeErrorKind(utils/journal-state.ts),scopesEqual(packages/wallet-core/src/activity/scope.ts),OFFSCREEN_KEEPALIVE(wallet/utils/offscreen.ts; the messaging package's own private constant stays), and the unusedaddressandsymbolfields of the privateAssetPricingrecord inutils/fee-estimation.ts(the issue namedaddress;symbolwas equally unread).auto-imports.d.tsand.eslintrc-auto-import.json.TokenSeeder'sgetVersionis required. Every constructor already passes one, so the never-takenchrome.runtime.getManifest()fallback goes.networkandfpcslices' restore-error field lists go fromRESTORE_ERROR_FIELDS_BY_SERVICE.normalizeBackupDatarefuses any backup carrying either slice (pinned bybackup-migration-registry.test.ts), and no restore path records errors under either name, so no backup reaches them. Both pinned backups (stored-shapes/backups/) carry neither slice and pass unedited.readSendPickswith whole-map expectations; the restore-error projection tests that used"network"as a stand-in now use"token", which has the same field list, expectations unchanged. The one test of a network row's endpoint URL went with the entry.composables/full-backup-restore.tsnow name the slice-client loop without a count;wallet/services/execution/README.mdsays whatservice.tsholds (the estimate envelopes, the held-send fee question, display decoding, the create-authwit message hash). The type-roles scanner's doc comment drops the removed example name.Left out, as the issue allows: the optional slice-name test. npm-staged
@nulo-sh/*entries are untouched.Proofs
apps/extension/tests/e2e, so no local e2e ran; the four e2e lanes in CI are the gate of record.gpt-6.1-sol, high, read-only) over the diff, asked whether a removed symbol is still reached, whether an older backup reads differently, whether a layer or a published entry is crossed, and whether a test lost live coverage. Verdict: approve, one README nit (the authwit hash's binding differs by intent kind), fixed and verified on resume.Validation
At
b6198d28f(the head,f65151456, differs by one README line), retry 0, one at a time:bun run lint,bun run typecheck:all,bun run test(1066 files passed),bun run test:ci-gating(784 pass),packages/wallet-coretests (361 passed). The Chrome build leavesapps/extension/src/types/clean after the regeneration.No visible change.
Closes #1983
🤖 Generated with Claude Code