onionwire/crates/onionwire-sdk/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
agent 0043fa0b34
All checks were successful
ci / test (pull_request) Successful in 5m53s
ci / sdk (pull_request) Successful in 1m35s
android-ci / android (pull_request) Successful in 12m30s
ci / fuzz (pull_request) Successful in 4m55s
node: remember a created wallet in the store's catalogue
A wallet created in-app was never remembered: `Node::wallet_create` called
the RPC and returned the seed, and the wallet file name was the one
hardcoded `wallet::DEFAULT_WALLET_FILENAME` ("onionwire"). A second create
reused that name, so the RPC refused it (or opened the first wallet's
file) and no row was ever written — the "cannot create a new wallet, and
nothing survives a restart" report.

Creation and import now go through the catalogue (t_64c9ba3c's
`Store::{create_wallet,list_wallets}`):

- each create/import gets its own file name, `onionwire-<n>` for the first
  `n` the catalogue does not hold, so several wallets coexist;
- the stored row (id, identity, locator, file, created_at) is returned:
  `Node::wallet_create` -> `CreatedWallet` (row + the one-time seed, with a
  redacting `Debug`), `Node::wallet_restore` -> `WalletRecord`;
- `Node::list_wallets` reads the catalogue without dialing;
- the child config is re-pointed at the new file (read-modify-write, so the
  sealed RPC creds survive) — a row the child never opens would still be a
  broken wallet.

The SDK keeps its UniFFI signature (`create_wallet -> String` seed,
`import_wallet -> ()`), so no Kotlin change: it unwraps `.seed`.

TDD: 5 new `src/node.rs` cases (row + list, two wallets + reopen, import,
wallet-off empty list, child re-pointed) over a loopback wallet-RPC mock.
`cargo test --locked` exit 0, `cargo clippy --locked --all-targets -- -D
warnings` clean, and the same two commands are clean in
`crates/onionwire-sdk`.
2026-09-21 10:57:55 -04:00
..
bin feat(android): SDK AAR (UniFFI) + Compose APK, Arti rustls feature split 2026-09-10 18:20:19 -04:00
lib.rs node: remember a created wallet in the store's catalogue 2026-09-21 10:57:55 -04:00