Skip to content

feat: add local test-utils crates (arbitrary, btc, btcio)#38

Merged
prajwolrg merged 10 commits intomainfrom
feat-strata-asm-test-utils
Mar 24, 2026
Merged

feat: add local test-utils crates (arbitrary, btc, btcio)#38
prajwolrg merged 10 commits intomainfrom
feat-strata-asm-test-utils

Conversation

@prajwolrg
Copy link
Copy Markdown
Collaborator

@prajwolrg prajwolrg commented Mar 24, 2026

Description

  • Introduces three new workspace-local test utility crates under crates/test-utils/:

    • strata--test-utils-arb — generic Arbitrary generator backed by OsRng
    • strata--test-utils-btcBtcMainnetSegment fixture loader providing real mainnet blocks (around difficulty-adjustment boundary 40_320) and 1_ 000 contiguous headers (heights 40_000–50_000) for header-chain verification tests.
    • strata-test-utils-btcio — regtest Bitcoin transaction utilities (funding, signing, MuSig2 multi-sig, broadcasting)
  • Removes three external strata-test-utils* git dependencies (strata-test-utils, strata-test-utils-btc, strata-test-utils-btcio) from the alpen, replacing all usages with the new local crates.

  • Refactors all downstream consumers (btc-verification, common, proof/statements, worker, all subprotocol crates, all txs crates, and integration tests) to import from the new strata-asm-test-utils-* crates.

  • Improves header_verification tests to use BtcMainnetSegment directly, avoiding the cyclic dev dependency.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency update
  • Security fix

Notes to Reviewers

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

Related Issues

@prajwolrg prajwolrg marked this pull request as draft March 24, 2026 03:01
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 24, 2026

Commit: 9de13ed
SP1 Execution Results

program cycles success
ASM STF 533,229,453 yes

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 92.01954% with 49 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/test-utils/btcio/src/harness.rs 53.84% 30 Missing ⚠️
crates/test-utils/arb/src/lib.rs 86.36% 3 Missing ⚠️
crates/test-utils/btc/src/lib.rs 94.64% 3 Missing ⚠️
crates/test-utils/btcio/src/signing.rs 95.58% 3 Missing ⚠️
crates/test-utils/btcio/src/submit.rs 97.56% 3 Missing ⚠️
crates/test-utils/btcio/src/transaction.rs 91.89% 3 Missing ⚠️
crates/btc-verification/src/header_verification.rs 97.97% 2 Missing ⚠️
crates/test-utils/btcio/src/address.rs 95.45% 1 Missing ⚠️
crates/test-utils/btcio/src/utils.rs 83.33% 1 Missing ⚠️
Files with missing lines Coverage Δ
crates/btc-verification/src/utils_btc.rs 100.00% <100.00%> (ø)
crates/common/src/aux/provider.rs 95.87% <ø> (ø)
crates/proof/statements/src/test_utils.rs 100.00% <100.00%> (ø)
crates/subprotocols/admin/src/handler.rs 94.71% <ø> (+5.79%) ⬆️
crates/subprotocols/admin/src/state.rs 99.43% <ø> (ø)
crates/subprotocols/bridge-v1/src/handler.rs 95.78% <ø> (ø)
...tes/subprotocols/bridge-v1/src/state/assignment.rs 95.17% <ø> (-0.22%) ⬇️
crates/subprotocols/bridge-v1/src/state/bitmap.rs 97.60% <ø> (ø)
crates/subprotocols/bridge-v1/src/state/bridge.rs 98.33% <ø> (ø)
crates/subprotocols/bridge-v1/src/state/deposit.rs 100.00% <ø> (ø)
... and 22 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@prajwolrg prajwolrg marked this pull request as ready for review March 24, 2026 03:21
@prajwolrg prajwolrg changed the title feat: add strata-asm-test-utils crate and consolidate test fixtures feat: add local test-utils crates (arb, btc, btcio) Mar 24, 2026
@prajwolrg prajwolrg changed the title feat: add local test-utils crates (arb, btc, btcio) feat: add local test-utils crates (arbitrary, btc, btcio) Mar 24, 2026
@prajwolrg prajwolrg self-assigned this Mar 24, 2026
@prajwolrg prajwolrg enabled auto-merge March 24, 2026 07:49
@prajwolrg prajwolrg disabled auto-merge March 24, 2026 07:50
@prajwolrg prajwolrg merged commit 52de7e6 into main Mar 24, 2026
21 of 22 checks 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