Skip to content

test: add BeaconDepositDataSpecTest spec coverage #957

@shane-moore

Description

@shane-moore

Parent

Part of #954 (split from PR #840).

What

Add BeaconDepositDataSpecTest to the spec test suite. Mirrors Go's GenerateETHDepositData() which validates deposit signing root computation.

Reference implementation

Branch test/simple-spec-test-types, file: anchor/spec_tests/src/types/beacon_deposit_data.rs

Details

  • Parses validator public key, withdrawal credentials, and fork version from fixture
  • Constructs a DepositMessage with ChainSpec::mainnet().max_effective_balance
  • Computes domain via spec.compute_domain(Domain::Deposit, fork_version, Hash256::ZERO)
  • Validates signing_root matches expected value
  • Fixture validator PK has no 0x prefix (test prepends it)
  • 1 fixture: beacon.DepositDataSpecTest_deposit_data_root_and_ssz.json

Changes needed

  1. New file: anchor/spec_tests/src/types/beacon_deposit_data.rs
  2. Add module + re-export in anchor/spec_tests/src/types/mod.rs
  3. Add dispatch arm "beacon.DepositDataSpecTest" in anchor/spec_tests/src/runner/types_dispatcher.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions