Skip to content

Consolidate duplicated EVM code in bugc tests#176

Merged
gnidan merged 1 commit intomainfrom
evm-consolidate-bugc-tests
Mar 9, 2026
Merged

Consolidate duplicated EVM code in bugc tests#176
gnidan merged 1 commit intomainfrom
evm-consolidate-bugc-tests

Conversation

@gnidan
Copy link
Member

@gnidan gnidan commented Mar 9, 2026

Summary

Removes ~355 lines of duplicated EVM executor and machine adapter code from bugc's test directory by importing from @ethdebug/evm instead.

Deleted files:

  • test/evm/evm-executor.ts — near-identical copy of @ethdebug/evm's Executor class
  • test/examples/machine-adapter.ts — near-identical copy of createMachineState()

Changes:

  • test/evm/index.ts re-exports Executor as EvmExecutor from @ethdebug/evm, preserving the name used by debug-*.ts scripts
  • test/examples/runners.ts imports Executor and createMachineState directly from @ethdebug/evm
  • Added @ethdebug/evm as devDependency, removed now-unused direct @ethereumjs/* devDependencies
  • Added evm to tsconfig project references for build ordering

All 868 tests pass.

Replace duplicated EvmExecutor and createMachineState in
bugc/test with imports from @ethdebug/evm:

- Remove test/evm/evm-executor.ts (272 lines)
- Remove test/examples/machine-adapter.ts (83 lines)
- Update test/evm/index.ts to re-export Executor as
  EvmExecutor from @ethdebug/evm (keeps debug script
  compatibility)
- Update test/examples/runners.ts to import directly
  from @ethdebug/evm
- Add @ethdebug/evm as devDependency, remove now-unused
  direct @ethereumjs/* devDependencies
- Add evm to tsconfig project references
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-03-09 20:12 UTC

@gnidan
Copy link
Member Author

gnidan commented Mar 9, 2026

Review (compiler agent): Looks good. Clean consolidation.

  • Verified @ethdebug/evm exports all needed symbols (Executor, ExecutionOptions, ExecutionResult, createMachineState)
  • Executor class has all the same methods the old EvmExecutor had: deploy, execute, executeCode, getStorage, setStorage, getCode, getContractAddress, getDeployerAddress, reset
  • Re-export alias in test/evm/index.ts preserves the name used by debug scripts
  • Dependency cleanup is correct — removes 5 unused direct @ethereumjs/* devDeps, adds @ethdebug/evm
  • tsconfig project reference addition is correct for build ordering

No issues found.

@gnidan gnidan merged commit e8438e8 into main Mar 9, 2026
4 checks passed
@gnidan gnidan deleted the evm-consolidate-bugc-tests branch March 9, 2026 20:07
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