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
test(cketh): build the live balance-scan harness on the shared fixtures (#11124)
## Summary
The live-anvil balance-scan harness had grown into a second test
fixture: it created and funded canisters, sequenced their installs, and
registered ckERC20 tokens on its own, in parallel with the fixtures
every other cketh integration test already uses. This PR removes that
duplication — the harness now builds on the shared fixtures and keeps
only what is genuinely specific to it: the local Ethereum node it owns,
and the balance-scan assertions.
Collapsing the two fixtures meant removing the knobs the duplicate had
accumulated:
- **Whether PocketIC runs live is decided once, after construction, not
by the chain under test.** Every fixture — mocked or live — builds on an
ordinary, non-live PocketIC instance, where setup calls tick
deterministically; only `LiveBalanceScanSetup::new_live` switches the
instance to auto-progress, and only once its whole fixture — including
the ledger-suite orchestrator and the tokens it registers — is already
built. Building against a live (wall-clock-paced) instance from the
start made every setup call race a round deadline it didn't control,
which reproducibly failed under CPU contention.
- **The harness owns the local Ethereum node** rather than borrowing a
URL to it, so the type proves a node is really running behind that URL.
- **Callers can no longer supply a pre-built environment.** The chain
under test already determines the canisters' init args, and every caller
was passing exactly what would have been built anyway — the parameter
only offered a way to get it wrong.
- **Canisters are created and installed in the same order for every
chain under test**, as on master; only their init args differ. The
harness' dedicated controller and its skipped ledger install turned out
not to be load-bearing: the anonymous principal already controls
everything PocketIC creates by default, and the skipped install was down
to a Bazel data dependency that simply wasn't declared.
- **Token registration goes through a real ledger-suite orchestrator**
instead of the harness impersonating one with placeholder ledgers —
which is what testing the deposit flow will need next.
- **The set of tokens the balance scan credits with anvil bytecode is
now exactly the set the orchestrator registered**, not a separately
hardcoded list — `Holding` and the harness' token-facing methods take
the orchestrator's own token type directly, so the two can no longer
silently drift apart.
Behaviour of the mocked fixtures is otherwise unchanged: same canister
creation order, same derived minter address, and the same cold-start
property the deposit-flow tests depend on. One thing did change for
every fixture, mocked included: canisters are now funded with `u64::MAX`
cycles rather than `u128::MAX` — the amount that reproducibly crashes
the live harness' replica on its first HTTPS outcall — deliberately
funding every fixture the same way rather than carrying two cycle
amounts. No cketh test asserts on cycle balances, so this is not
expected to be observable.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0 commit comments