Skip to content

Add Anvil FVM precompile test helpers#664

Draft
anjor wants to merge 1 commit intomainfrom
fvm-precompile-test-helpers
Draft

Add Anvil FVM precompile test helpers#664
anjor wants to merge 1 commit intomainfrom
fvm-precompile-test-helpers

Conversation

@anjor
Copy link
Copy Markdown
Collaborator

@anjor anjor commented Apr 17, 2026

What changed

This adds a small util/testutil helper for Anvil-backed integration tests that need Filecoin precompile addresses to exist.

  • deploy vendored mock bytecode at the canonical 0xfe... Filecoin precompile addresses
  • add SetupFVMPrecompiles and RegisterActorID helpers for tests
  • add integration tests covering exact RESOLVE_ADDRESS behavior and the minimal supported actor-call happy paths

Why

Some integration tests want contracts to stop reverting on empty Filecoin precompile addresses when running against an Anvil fork.

This is intended as an incremental test utility. It makes narrow precompile-backed test cases possible without implying that Anvil now emulates full Filecoin actor behavior.

Impact

Tests can now opt into lightweight precompile mocks when they need address resolution or minimal actor-call behavior.

This does not unblock the real DDO allocation flow end-to-end. In particular, it does not emulate the full DataCapAPI.transfer / VerifReg path used by createAllocationRequests.

Validation

  • go test ./util/testutil -run 'TestIntegration_FVM' -count=1

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