refactor: walletkit-core uses walletkit-secure-store#398
Closed
danielle-tfh wants to merge 1 commit into
Closed
Conversation
Stacked on the walletkit-secure-store crate. Migrates walletkit-core's storage layer to consume the shared primitives: - vault/ uses Vault::open + Blobs::put for SQLCipher open + blob inserts. blob_objects table moves to Blobs::ensure_schema; credential-specific tables (credential_records, vault_meta) stay in vault/schema.rs. - keys.rs delegates to init_or_open_envelope_key with the existing ACCOUNT_KEYS_FILENAME and ACCOUNT_KEY_ENVELOPE_AD constants. - lock.rs collapses to a re-export aliased to StorageLock / StorageLockGuard for in-tree stability. - envelope.rs deleted (replaced by walletkit_secure_store::KeyEnvelope). - traits.rs adds DeviceKeystoreAdapter / AtomicBlobStoreAdapter that bridge the uniffi-annotated FFI traits to the new crate's plain-Rust Keystore / AtomicBlobStore. Hosts (Kotlin / Swift) see no change. - error.rs adds From<StoreError> for StorageError so ? converts cleanly at the boundary. - types.rs drops BlobKind::as_i64 (consumers now pass `as u8`). On-disk format unchanged: same envelope CBOR layout, same content_id byte layout (SHA-256(prefix || [kind_byte] || plaintext)), same SQL schemas. Existing user databases keep working without migration. 95 walletkit-core lib tests + 17 vault tests pass; clippy clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Stacked on #397. Migrates
walletkit-core's storage layer to consume the shared primitives sowalletkit-secure-storehas its first real consumer and OrbKit can pick it up next.What changed
vault/usesVault::open+Blobs::put.blob_objectsschema moves toBlobs::ensure_schema; credential-specific tables (credential_records,vault_meta) stay invault/schema.rs.keys.rsdelegates toinit_or_open_envelope_keywith the existingACCOUNT_KEYS_FILENAME/ACCOUNT_KEY_ENVELOPE_ADconstants.lock.rscollapses to a re-export aliased toStorageLock/StorageLockGuard.envelope.rsdeleted (replaced bywalletkit_secure_store::KeyEnvelope).traits.rsaddsDeviceKeystoreAdapter/AtomicBlobStoreAdapterbridging theuniffi-annotated FFI traits to the new crate's plain-Rust ones. Hosts (Kotlin / Swift) see no change.error.rsaddsFrom<StoreError> for StorageErrorfor?conversion at the boundary.types.rsdropsBlobKind::as_i64(consumers passas u8).On-disk format unchanged — same envelope CBOR, same
content_idbytes (SHA-256(prefix || [kind_byte] || plaintext)), same SQL schemas. Existing user databases keep working.95 walletkit-core lib tests + 17 vault tests pass; clippy clean.