Skip to content

tests: add integration test suite for clawrtc-rs public API (Closes #16256) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #56

Open
waterWang wants to merge 1 commit into
Scottcjn:mainfrom
waterWang:tests/integration-test-suite-16256
Open

tests: add integration test suite for clawrtc-rs public API (Closes #16256) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]#56
waterWang wants to merge 1 commit into
Scottcjn:mainfrom
waterWang:tests/integration-test-suite-16256

Conversation

@waterWang

Copy link
Copy Markdown

Integration test suite for clawrtc-rs public API

Closes Scottcjn/rustchain-bounties#16256

Summary

The crate handles Ed25519 wallets and hardware attestation — critical for signing. This PR extends the integration test suite in tests/public_api.rs to cover the remaining public API surface that was previously untested.

Previously the suite had 7 integration tests. This PR adds 6 new integration tests (now 13 total) covering:

New tests

Public API item Test
CpuArch::multiplier() (all 8 variants) cpu_arch_multipliers_all_variants
CpuArch::family() (all 8 variants) cpu_arch_family_strings
CpuArch::arch_str() (all 8 variants) cpu_arch_arch_strings
Wallet::from_private_key() wallet_from_private_key_roundtrips
Wallet::from_hex() edge cases wallet_from_hex_edge_cases
Wallet::verify() validation wallet_verify_edge_cases

Coverage of remaining public API items

  • Wallet roundtrip (already covered): wallet_roundtrip_sign_verify_and_rejection_paths — generate → serialize → deserialize → same address/pubkey; sign → verify; verify fails on tampered message, tampered signature, wrong key
  • Address derivation vectors (already covered): rtc_address_vectors_are_stable — 3 fixed RFC 8032 keypairs with expected RTC… addresses
  • Attestation (already covered): attestation_is_deterministic_for_fixed_inputs + malformed_attestation_returns_error_without_panicking
  • Error paths (already covered + extended): wallet_result_apis_reject_invalid_inputs, node_read_result_apis_reject_invalid_json, enroll_returns_node_error_for_rejected_input, plus new wallet_verify_edge_cases and wallet_from_hex_edge_cases

Verification

  • cargo test --all-targets passes: 8 unit + 13 integration = 21 tests, all green
  • Tests are meaningful assertions (not assert!(true) filler)
  • CI workflow already exists (.github/workflows/ci.yml) and runs cargo test --all-targets on push/PR

Adds 6 new integration tests covering the remaining public API surface:

- cpu_arch_multipliers_all_variants — all 8 CpuArch multiplier values
- cpu_arch_family_strings — all 8 CpuArch family() return values
- cpu_arch_arch_strings — all 8 CpuArch arch_str() return values
- wallet_from_private_key_roundtrips — raw 32-byte key roundtrip
- wallet_from_hex_edge_cases — empty, short, long, exact-length hex
- wallet_verify_edge_cases — empty pubkey, empty sig, wrong lengths

Closes Scottcjn/rustchain-bounties#16256
@Scottcjn

Scottcjn commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Checked this today. The work is not the problem — the PR is blocked on a failing check: test.

gh pr checks 56 -R Scottcjn/clawrtc-rs will show it, and the linked job log has the exact lines. Push a fix to the same branch and it re-runs automatically.

If the failure looks like it is our config rather than your change, say so here and I will check. That has already turned out to be the case on several PRs today.

Apologies for the delay in telling you.

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.

[BOUNTY: 10 RTC] clawrtc-rs: integration test suite — wallet roundtrip, address vectors, attestation determinism, error paths

2 participants