Skip to content

fix: add withdrawal integration test and clear pre-existing lint debt#2

Merged
douglance merged 2 commits into
mainfrom
fix/withdrawal-tests-and-lint
Apr 16, 2026
Merged

fix: add withdrawal integration test and clear pre-existing lint debt#2
douglance merged 2 commits into
mainfrom
fix/withdrawal-tests-and-lint

Conversation

@douglance
Copy link
Copy Markdown
Collaborator

Summary

  • Adds L2→L1 / L3→L2 ETH withdrawal integration test that drives ArbSys.withdrawEth, builds an outbox proof via NodeInterface.constructOutboxProof, polls until the assertion is confirmable, and executes on the parent. Verifies the recent BoLD staker-switch-interval reduction (d41d5a9) actually delivers fast withdrawals end-to-end (30s SLO).
  • Isolates the integration run in vitest.integration.config.ts and excludes test/integration/** from the default test run so pnpm validate remains hermetic.
  • Clears 29 pre-existing Biome lint errors across 8 files so pnpm validate is green again. Mostly mechanical (block statements, template-literal → string, delete → biome-ignore where semantics require it) plus a few complexity refactors (clean.ts, init.ts, snapshot.ts, test/token-bridge.test.ts).
  • Removes dead code orphaned by the recent docker→SDK deploy migration (30094b4): L2_DEPOSIT_VALUE, getErrorMessage, L2_L3_FACTORY_GAS_LIMIT, runCompose, composeRunArgs.

Test plan

  • pnpm lint — 0 errors
  • pnpm typecheck — clean
  • pnpm build — clean
  • pnpm test:run — 128/128 passing; test/integration/** excluded
  • pnpm vitest --config vitest.integration.config.ts against a live pnpm dev testnode — confirm both withdrawal cases close under 30s (requires local L1/L2/L3 running; run before merge)

Verifies the BoLD staker-switch-interval reduction (d41d5a9) actually
lets withdrawals confirm quickly end-to-end. Drives ArbSys.withdrawEth
on the child chain, builds an outbox proof via NodeInterface, polls
until the assertion is confirmable, and executes on the parent.

- Adds withdrawal executor (src/withdraw.ts) and vitest integration
  suite covering both L2 to L1 and L3 to L2 paths against a running
  local testnode (30s SLO).
- Adds arbSys / nodeInterface / outbox ABIs to src/rpc.ts.
- Isolates the integration run in vitest.integration.config.ts and
  excludes test/integration/** from the default pnpm test run so
  pnpm validate stays hermetic.
Brings pnpm lint back to zero errors so pnpm validate is green.

- Refactor high-complexity functions into small helpers:
  clean.ts, init.ts, snapshot.ts, and the mocked execOrThrow
  implementation in test/token-bridge.test.ts.
- Drop dead code orphaned by the docker-to-SDK deploy migration
  (30094b4): L2_DEPOSIT_VALUE and getErrorMessage in init.ts,
  L2_L3_FACTORY_GAS_LIMIT / runCompose / composeRunArgs in
  token-bridge.ts.
- Replace a non-null assertion in snapshot.ts with an explicit
  undefined check.
- Minor style fixes: useBlockStatements in chainForRpc,
  noUnusedTemplateLiteral in snapshot.ts.
- Keep delete on process.env and nitro config-key removals where
  assigning undefined changes semantics; document each with a
  targeted biome-ignore.
- Formatter-only touch-ups in scripts/action/run.mjs, fee-token.ts,
  sdk-chain.ts, and exec.test.ts required for biome check to pass.
@douglance douglance merged commit 3214ac6 into main Apr 16, 2026
1 check passed
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.

1 participant