-
Notifications
You must be signed in to change notification settings - Fork 73
crates: move secure_db to shared crates/ directory #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR centralizes the secure_db logic into a shared crates/secure_db folder and updates all clients to consume the new crate rather than local modules.
- Moved and restructured secure storage functions into
crates/secure_db - Updated
eth_walletTA to useSecureStorageClientfrom the shared crate - Adjusted example and workspace manifests to point at the new crate path
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/web3/eth_wallet/ta/src/wallet.rs | Added Storable impl and imported secure_db::Storable |
| projects/web3/eth_wallet/ta/src/secure_storage.rs | Removed local secure storage implementation |
| projects/web3/eth_wallet/ta/src/main.rs | Replaced direct storage calls with SecureStorageClient usage |
| projects/web3/eth_wallet/ta/build.rs | Minor whitespace cleanup |
| projects/web3/eth_wallet/ta/Cargo.toml | Added secure_db crate dependency |
| examples/secure_db_abstraction-rs/ta/src/main.rs | Removed local mod secure_db; now uses shared crate |
| examples/secure_db_abstraction-rs/ta/Cargo.toml | Added shared secure_db dependency; removed direct bincode |
| crates/secure_db/src/db.rs | Fixed import path for storage functions |
| crates/secure_db/src/client.rs | Fixed import path for SecureStorageDb |
| crates/secure_db/src/backend.rs | Streamlined match arms and buffer sizing |
| crates/secure_db/Cargo.toml | New crate manifest with dependencies |
Comments suppressed due to low confidence (3)
projects/web3/eth_wallet/ta/src/main.rs:175
- The error message for unsupported commands could include the command ID or name for easier troubleshooting.
_ => bail!("Unsupported command"),
projects/web3/eth_wallet/ta/src/main.rs:86
- New storage operations (
db_client.put,db_client.get,db_client.delete_entry) are introduced here and in other handlers; consider adding unit or integration tests to cover these paths.
fn create_wallet(
crates/secure_db/Cargo.toml:27
- The
secure_dbcrate pinsbincode = "1.0", while examples previously usedbincode = "1.3.3". Aligning versions across crates will prevent dependency conflicts.
bincode = "1.0"
a0b1baa to
45946b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR reorganizes the project structure by moving the secure_db module into a shared crates/ directory, enabling its use by both the eth_wallet and secure_db_abstraction examples.
- Moved secure_db into the shared crates/ directory and updated dependency references in Cargo.toml files.
- Refactored the TA’s main.rs to replace the old secure_storage module with the SecureStorageClient from secure_db.
- Updated the secure_db crate’s trait bounds and backend functions to standardize key conversion and error handling.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| projects/web3/eth_wallet/ta/src/wallet.rs | Added implementation of the Storable trait for Wallet to support secure storage. |
| projects/web3/eth_wallet/ta/src/secure_storage.rs | Removed obsolete secure_storage code in favor of the new secure_db usage. |
| projects/web3/eth_wallet/ta/src/main.rs | Updated session management and secure storage functions to use SecureStorageClient. |
| projects/web3/eth_wallet/ta/build.rs | Minor adjustments in module imports. |
| projects/web3/eth_wallet/ta/Cargo.toml | Added dependency reference for secure_db. |
| examples/secure_db_abstraction-rs/ta/src/main.rs | Removed references to the old secure_db module and updated Storable trait usage. |
| examples/secure_db_abstraction-rs/ta/Cargo.toml | Updated dependency reference for secure_db. |
| crates/secure_db/src/{storable.rs,db.rs,client.rs,backend.rs} | Updated trait bounds, error handling, and key conversion logic within secure_db. |
| crates/secure_db/Cargo.toml | New Cargo.toml for the shared secure_db crate. |
Reorganize basic modules to promote reuse and improve the development experience for TAs. * the secure_db module has been moved into the crates directory. * adjusted secure_db_abstraction and eth_wallet examples to use the secure_db crate. Signed-off-by: Yuan Zhuang <yuanz@apache.org> Acked-by: Zehui Chen <ivila@apache.org>
|
Any other comments before merging? @m4sterchain |
Feel free to merge after all comments are resolved. Thanks. |
This PR reorganizes basic modules to promote reuse and improve the development experience for TAs.
secure_dbmodule has been moved into thecratesdirectory.secure_db_abstractionandeth_walletexamples.Future Plans:
cratesto encourage code reuse and simplify TA development.crates.io, making them easily accessible to the community.