Files
routstrd/tests/utils
redshift 99f55d3bae chore(wallet): remove the dead legacy cocod client
The external `cocod` binary was replaced by the in-process Coco wallet
long ago, but its HTTP/unix-socket client kept shipping ~280 lines of
unreachable code next to the wallet contract.

Remove it:

- delete `createCocodClient` (spawns `cocod init`, talks over a unix
  socket, takes a cross-process startup lock) and its helpers
  `resolveCocodExecutable`, `isCocodInstalled`, `normalizeBalances`
  and `CocodBalanceOutput`. None of them are reachable from production
  or from tests; `isCocodInstalled` had no callers at all.
- drop the `options.walletClient || createCocodClient(...)` fallback in
  `createWalletAdapter`. The daemon always passes the in-process client
  built by `createCocoClient()`, so `walletClient` is now required and
  the adapter can no longer silently spawn an external binary.
- drop the vestigial `cocodPath` config key, which only ever fed that
  fallback.
- delete the "legacy cocod client NPC passthroughs" test block, which
  covered only the deleted client.

The shared wallet contract moves from `cocod-client.ts` to
`wallet-client.ts` and loses its `Cocod` prefixes (`WalletClient`,
`WalletRuntimeState`, `WalletHttpError`) — none of it describes cocod
any more. `WalletRuntimeState` avoids colliding with the existing
`WalletState` in `wallet-state.ts`.

Legacy cocod *migration* code is deliberately untouched: `stopLegacyCocod`,
`assertLegacyCocodNotRunning`, `claimLegacyCocodPidFile`, `migration.ts`
and the `legacyCocod*` paths still migrate an existing `~/.cocod` wallet
and fence off a running external daemon.

Net -456 lines. Existing configs that still contain `cocodPath` load
unchanged (unknown keys are ignored) — the key is just no longer written.
2026-10-02 16:59:42 +08:00
..