Skip to content

refactor: move primitives crates to crates/primitives#292

Draft
danielbui12 wants to merge 2 commits into
devfrom
primitives_refactoring
Draft

refactor: move primitives crates to crates/primitives#292
danielbui12 wants to merge 2 commits into
devfrom
primitives_refactoring

Conversation

@danielbui12

@danielbui12 danielbui12 commented Jul 16, 2026

Copy link
Copy Markdown
Member
  • Move primitives/, storage-interfaces/{file-system,s3}/primitives into crates/primitives/{storage,file-system,s3}; package names unchanged
  • Split each primitves/*/lib.rs into per-concept modules, re-exported from the crate root, so no consumer changes
  • Bring all types from pallets to primitives

- Move primitives/, storage-interfaces/{file-system,s3}/primitives into
  crates/primitives/{storage,file-system,s3}; package names unchanged
- Move the two wired examples into the file-system crate (cargo
  auto-discovery) and drop their [[example]] path overrides
- Split each lib.rs into per-concept modules (storage: provider/
  challenge/mmr/commitment/checkpoint; file-system: proto/bounds/
  directory/manifest/convert/error/drive/cid; s3: bounds/bucket/
  object/error) re-exported from the crate root, so no consumer changes
- Update workspace member/dependency paths, CI migration paths-filter,
  license-header includes, and doc path references
- Note: scale-info type paths in runtime metadata changed; regenerate
  crates/storage-subxt bindings via `just subxt-codegen` later (crate
  has no consumers yet, SCALE encoding unaffected)
…ives

- Move ProviderInfo/ProviderSettings/ProviderStats, Member/Bucket,
  StorageAgreement, and Challenge/ChallengeResponse into
  crates/primitives/storage with explicit generics; the pallet keeps
  same-named T-binding aliases so declarations stay unchanged
- Marker-carrying types (ProviderInfo, Bucket, ChallengeResponse) use
  manual Clone/PartialEq/Eq/Debug impls so Get<u32> markers need no
  trait impls; ProviderInfo follows the DriveInfo mel_bound() pattern
- ProviderSettings serde derives are feature-gated with deserialize
  bounds carrying Zero + Bounded for the container default attr
- storage-primitives gains sp-runtime; pallet enables its serde feature
- Add turbofish (::<T>/::<Test>/::<Runtime>) at construction sites where
  alias inference cannot resolve T through projections (E0284)
- Update justfile subxt --derive-for-type paths to the new
  storage_primitives::provider::* metadata paths (regen still deferred)
- SCALE encodings are byte-identical; only metadata type paths change
@danielbui12 danielbui12 self-assigned this Jul 16, 2026
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