Skip to content

Conversation

@m-005
Copy link
Member

@m-005 m-005 commented Jan 16, 2026

Summary

  • Add comprehensive data-layer test utilities to objects-test-utils
  • Migrate all objects-data tests to use new foundation
  • Delete objects-data/tests/common/mod.rs (322 lines of duplication eliminated)

Changes

New utilities (objects-test-utils/src/data.rs):

  • asset(), asset_with_hash() - Asset factories with sensible defaults
  • project(), project_from_replica() - Project factories
  • reference() - Reference factory
  • signed_asset_passkey(), signed_asset_wallet() - Complete SignedAsset workflows
  • Structured bundle types: SignedAssetPasskeyBundle, SignedAssetWalletBundle
  • Uses proper encoding patterns: hex::encode(crypto::deterministic_bytes(seed))

Test migration:

  • Rewrote integration_test.rs (748 lines, 36 tests)
  • Migrated property_test.rs (15 tests)
  • Deleted objects-data/tests/common/mod.rs (322 lines)

Dependencies:

  • Added sha2, base64, alloy-primitives to objects-test-utils
  • Added objects-data dependency for tier-2 utilities
  • Added objects-test-utils dev-dependency to objects-data

Test Results

All tests passing:

  • ✅ 36 integration tests
  • ✅ 15 property tests
  • ✅ 21 objects-test-utils self-tests

Verification

cargo test -p objects-test-utils
cargo test -p objects-data
cargo clippy --workspace -- -D warnings
cargo fmt --all -- --check

Follows CLAUDE.md test patterns with battle-tested dependencies (alloy-primitives for EIP-191, RustCrypto p256/k256).

Add comprehensive data-layer test utilities to objects-test-utils and
migrate all objects-data tests to use the new foundation, eliminating
322 lines of duplicated test code.

**New utilities (objects-test-utils/src/data.rs):**
- Asset/Project/Reference factories with sensible defaults
- SignedAsset workflows for Passkey and Wallet signers
- Structured bundle types (SignedAssetPasskeyBundle, SignedAssetWalletBundle)
- Proper encoding patterns: test data mirrors production (bytes → hex)

**Migration:**
- Rewrote integration_test.rs (36 tests) to use new utilities
- Migrated property_test.rs (15 tests) to use new utilities
- Deleted objects-data/tests/common/mod.rs (322 lines)
- All 54 tests passing

**Dependencies:**
- Added sha2, base64, alloy-primitives to objects-test-utils
- Added objects-data dependency for tier-2 utilities
- Added objects-test-utils dev-dependency to objects-data

Follows CLAUDE.md test patterns with proper encoding and battle-tested
dependencies (alloy-primitives for EIP-191, RustCrypto p256/k256).
@m-005 m-005 merged commit db1446b into main Jan 16, 2026
5 checks passed
@claude
Copy link

claude bot commented Jan 16, 2026

No issues found. Checked for bugs and CLAUDE.md compliance.

@m-005 m-005 deleted the feat/test-utils-data branch January 16, 2026 03:44
m-005 added a commit that referenced this pull request Jan 16, 2026
Add comprehensive data-layer test utilities to objects-test-utils and
migrate all objects-data tests to use the new foundation, eliminating
322 lines of duplicated test code.

**New utilities (objects-test-utils/src/data.rs):**
- Asset/Project/Reference factories with sensible defaults
- SignedAsset workflows for Passkey and Wallet signers
- Structured bundle types (SignedAssetPasskeyBundle, SignedAssetWalletBundle)
- Proper encoding patterns: test data mirrors production (bytes → hex)

**Migration:**
- Rewrote integration_test.rs (36 tests) to use new utilities
- Migrated property_test.rs (15 tests) to use new utilities
- Deleted objects-data/tests/common/mod.rs (322 lines)
- All 54 tests passing

**Dependencies:**
- Added sha2, base64, alloy-primitives to objects-test-utils
- Added objects-data dependency for tier-2 utilities
- Added objects-test-utils dev-dependency to objects-data

Follows CLAUDE.md test patterns with proper encoding and battle-tested
dependencies (alloy-primitives for EIP-191, RustCrypto p256/k256).
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.

2 participants