Skip to content

fix(wallet-toolbox): remove unused WERR_NETWORK_CHAIN and ProcessSyncChunkResult.error - #551

Draft
sirdeggen wants to merge 1 commit into
mainfrom
cursor/wallet-toolbox-dead-code-541-542-884b
Draft

sirdeggen wants to merge 1 commit into
mainfrom
cursor/wallet-toolbox-dead-code-541-542-884b

Conversation

@sirdeggen

@sirdeggen sirdeggen commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #541 and #542.

Program and scope

Impact

  • No public package source or manifest changed
  • Public package source or manifest changed; affected packages are listed below
  • Infrastructure source, dependency, image, or deployment configuration changed
  • Public API, exports, types, runtime targets, or browser/mobile behavior changed
  • Security-sensitive boundary changed
  • Documentation or examples changed

Affected packages/services and intended patch versions (publication occurs only
through the release workflow after approval):

  • @bsv/wallet-toolbox 2.13.0 (unpublished candidate; no version bump)
  • @bsv/wallet-toolbox-client 2.13.1 and @bsv/wallet-toolbox-mobile 2.13.1 share the same source and inherit the type cleanup

Verification

  • Local commands and results:
    • pnpm --filter @bsv/wallet-toolbox typecheck passed
    • pnpm --filter @bsv/wallet-toolbox lint passed
    • pnpm --filter @bsv/wallet-toolbox-client typecheck passed
    • pnpm --filter @bsv/wallet-toolbox-mobile typecheck passed
    • wallet-toolbox jest (excluding man/live/bench/client/mobile): 241 suites, 2348 passed, 1 skipped
    • pnpm lint passed
    • pnpm format:check passed
    • pnpm health:check passed (208 script tests, docs/packages check, contributor policy, repository health)
  • Hosted CI run: SUCCESS on exact head fbb0b5f8fb1088907decf7fde4abadd65feb424a — 35 successful, 0 failed, 6 expected scope-based skips (SDK/DID/VeriFast coverage, non-coverage packages, mutation matrix, infra). Required merge-gate, CodeQL, Sonar quality gate, Socket, codecov/patch, and conformance all passed. Run: https://github.com/bsv-blockchain/ts-stack/actions/runs/35616993704
  • Conformance evidence: hosted CI / Conformance Vectors and required Conformance / ts-runner passed. BRC-40 completion still uses ProcessSyncChunkResult.done; no vector asserted error
  • Coverage delta: hosted wallet-toolbox coverage shards and aggregate upload passed; codecov/patch passed
  • Lint/typecheck delta: zero warnings locally; hosted CI / Build, lint, and policy passed
  • Browser/mobile/packed-consumer evidence: hosted CI / Platform / wallet browser and CI / Platform / wallet mobile passed. pack:check entry-exports never listed WERR_NETWORK_CHAIN
  • Performance or bundle-size delta: none expected
  • I self-reviewed the complete diff for correctness, security,
    compatibility, public API, artifacts, dependencies, docs, and operations
  • All applicable checks are terminal and successful on the exact head; any
    scope-based skip is expected and validated by the merge gate

Security and dependencies

  • No dependency or lockfile change
  • Changelog, runtime relevance, peer compatibility, transitive graph, and
    audit results were reviewed
  • CodeQL/negative tests cover any changed trust boundary
  • The exact-head CodeQL analysis has no new alert
  • The exact-head repository quality gate reports zero new Sonar findings
    (including accepted or false-positive issue states) and zero unreviewed hotspots;
    Sonar's aggregate Quality Gate passed verdict alone is not merge evidence
  • No new override, advisory dismissal, quality suppression, or skipped test
  • Any temporary exception is registered with owner, evidence, review date,
    and removal condition
  • Workflow permissions and lifecycle-script behavior remain least privilege

Release and operations

  • No npm publication was performed from a workstation or from this PR
  • Required npm patch bumps are included or intentionally deferred by the
    controlling program
  • Image/SBOM/provenance/deployment/rollback impact is documented (none)
  • Documentation, changelog, migration, and operational guidance are current

Decision

No existing live-sync call site throws a chain-mismatch WalletError. Portable BRC-38 import and ChainTracks ingest already throw generic Errors for different paths; rewiring those would invent new error identities. Go's ProcessSyncChunkResult has no Error field, and no TypeScript producer or consumer used error. Removal is the smallest correct fix.

Historical JSON with name WERR_NETWORK_CHAIN still deserializes as a generic WalletError.

Do not merge. Keep as draft pending maintainer review.

Open in Web Open in Cursor 

…ChunkResult.error

WERR_NETWORK_CHAIN was defined and deserialized but never thrown, and no
processSyncChunk producer or consumer set or read result.error. Remove the
dead surface instead of inventing new chain-mismatch or chunk-error
semantics. Historical JSON with that error name still deserializes as a
generic WalletError.

Closes #541
Closes #542

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(wallet-toolbox): WERR_NETWORK_CHAIN is defined and deserialized but never thrown

2 participants