chore(wallet/sdk): minor cleanup - #1627
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis PR consolidates the wallet storage abstraction by restructuring a monolithic storage module into separate error, reader, and writer components, fixes the typo Changes
Sequence Diagram(s)sequenceDiagram
actor Client
participant SDK as WalletSdk
participant Store as ReadableWalletStore/<br/>WriteableWalletStore
participant Tx as Transaction
rect rgb(200, 230, 255)
Note over Client,Tx: Read Flow (with_read_tx)
Client->>SDK: api.with_read_tx(closure)
SDK->>Store: create_read_tx()
Store->>Tx: create transaction
Tx-->>SDK: ReadTransaction
SDK->>Tx: closure(&mut tx)
Tx->>Tx: read operations
Tx-->>SDK: Result<R>
SDK-->>Client: Result<R>
end
rect rgb(230, 200, 255)
Note over Client,Tx: Write Flow (with_write_tx)
Client->>SDK: api.with_write_tx(closure)
SDK->>Store: create_write_tx()
Store->>Tx: create transaction
Tx-->>SDK: WriteTransaction
SDK->>Tx: closure(&mut tx)
Tx->>Tx: write operations
alt Success
Tx->>Tx: commit()
Tx-->>SDK: Ok(Result<R>)
else Error in Closure
Tx->>Tx: rollback()
Tx-->>SDK: Err(WalletStorageError)
end
SDK-->>Client: Result<R>
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (22)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
chore: move traits into modules
Motivation and Context
Investigating improvements to api with better atomicity, but unfortunately, was not able to figure it out without large changes. However part of that was moving traits into smaller modules, so why not PR it?
Summary by CodeRabbit
New Features
Bug Fixes
Refactor