Skip to content

Commit a3bd662

Browse files
committed
feat(mock): in-process mock wallet — offline login + signing, no device
Promote the proven SSO/statement-store responder into a public, feature-gated `mock_wallet` module (behind the `mock` feature; never in the default build). `MockWalletPlatform` composes `truapi-platform`'s `MockPlatform` for the ten platform-seam capabilities and answers `ChainProvider::connect` with a `MockWalletConnection` that completes the SSO pairing handshake (login) and answers signing requests over the statement-store channel — sr25519-signed and P-256/AES-GCM-encrypted, exactly as a paired wallet would. Closes the wallet-seam gap: login and signing now complete deterministically in-process. Through-core tests cover login-to-authenticated and sign_payload.
1 parent aad062e commit a3bd662

3 files changed

Lines changed: 700 additions & 0 deletions

File tree

rust/crates/truapi-server/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ crate-type = ["rlib", "cdylib"]
1010

1111
[features]
1212
default = []
13+
# Deterministic in-process mock wallet (dev/test only; never in the default
14+
# production WASM build). Pulls in truapi-platform's MockPlatform.
15+
mock = ["truapi-platform/mock"]
1316

1417
[dependencies]
1518
truapi = { path = "../truapi" }

rust/crates/truapi-server/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ pub mod transport;
2525
#[cfg(test)]
2626
pub(crate) mod test_support;
2727

28+
/// Deterministic in-process mock wallet (SSO/statement-store seam) composed with
29+
/// `truapi-platform`'s `MockPlatform`. Available in tests, or under the `mock`
30+
/// feature for out-of-crate consumers (browser E2E). Never in the default build.
31+
#[cfg(any(test, feature = "mock"))]
32+
pub mod mock_wallet;
33+
2834
pub mod generated;
2935

3036
#[cfg(target_arch = "wasm32")]

0 commit comments

Comments
 (0)