Wallets were only ever a file in $ONIONWIRE_HOME/wallet plus the single-row wallet_child config for the one the child is currently pointed at, so a created wallet was not remembered and a second create had nowhere to go. Add a 'wallets' table (id, name, identity_pubkey, onion_locator, wallet_filename, created_at) and CRUD on Store: create_wallet, get_wallet_by_id, list_wallets, delete_wallet. wallet_filename is UNIQUE so a second wallet cannot silently reuse the first one's file, and identity_pubkey is deliberately not unique (identity is the roster key, a wallet is a file; the locator may rotate or be empty). No new crate: the store is already rusqlite + SQLCipher with a raw PRAGMA key, and sqlx has no SQLCipher path, so a second pool would be a second unencrypted way in. Tests: 5 store cases in tests/store.rs (round-trip, coexistence across a reopen, duplicate filename, delete, blank label/filename) plus the at_rest upgrade case in src/store.rs.
25 lines
466 B
Rust
25 lines
466 B
Rust
pub mod backup;
|
|
pub mod cuprate;
|
|
pub mod dispatch;
|
|
pub mod file;
|
|
pub mod frame;
|
|
pub mod hs;
|
|
pub mod loc;
|
|
pub mod node;
|
|
pub mod outbox;
|
|
pub mod pay;
|
|
pub mod profile;
|
|
pub mod qr;
|
|
pub mod ratchet;
|
|
pub mod ratelimit;
|
|
pub mod sanitize;
|
|
pub mod session;
|
|
mod store;
|
|
pub mod tui;
|
|
pub mod wallet;
|
|
pub mod wallet_child;
|
|
|
|
pub use store::{
|
|
Friend, FriendProfile, Message, NewWallet, Payment, PaymentWrite, SelfIdentity, Store,
|
|
WalletRecord, resolve_store_passphrase,
|
|
};
|