testing/fake_wallet_session library

Classes

FakeWalletSession
A host-VM fake for WalletSession — no native library, no device. It mirrors the real watchSyncStatus contract (CURRENT status emitted on subscribe) and gives tests direct handles to drive the live stream (push / error / complete) and to count subscribes, cancels, snapshots, and start/stop calls.

Properties

defaultSendProposalBinding → Uint8List
The deterministic FR-17 spend-binding nonce sendProposalFixture (and via it shieldProposalFixture) defaults to — distinct from defaultSwapQuoteBinding so a test that mixes a proposal and a quote can tell whose bytes reached a seam.
final
defaultSwapQuoteBinding → Uint8List
The deterministic FR-17 spend-binding nonce swapQuoteFixture defaults to — distinct from defaultSendProposalBinding so a test that mixes a proposal and a quote can tell whose bytes reached a seam.
final

Functions

balanceFixture({int spendableZat = 0, int pendingIncomingZat = 0, int pendingChangeZat = 0, int transparentZat = 0, int totalZat = 0}) → BalanceSnapshot
ephemeralSweepSummaryFixture({int scanned = 1, int swept = 1, int recoveredZat = 250000, int failed = 0, int truncated = 0}) → EphemeralSweepSummary
A neutral EphemeralSweepSummary for recovery-sheet tests (2e-2b-v-2). Defaults to a clean funded recovery (one address swept, nothing failed or truncated); override to model partial faults / a heavy-wallet truncation.
inFlightSendFixture({int amountZat = 80000, int createdAt = 1700000000}) → InFlightSend
An in-flight two-step row (#309) — first leg broadcast, send not complete; drives the durable "on its way — don't send it again" cue.
parkedSendFixture({int id = 7, ParkedSendKind kind = ParkedSendKind.twoStep, int amountZat = 70000, int createdAt = 1700000000, bool paused = false, bool sending = false, Uint8List? binding, SigningBlock? signingBlock}) → ParkedSend
A neutral ParkedSend for "saved & pending" surface tests (2e-2b-v-3) — amount-only, with an id + enqueue timestamp the cancel flow passes back. Defaults to the two-step (one-time-address) kind, the surface's original shape; pass ParkedSendKind.singleStep for a plainly-queued offline send (#331 — the same surface carries both).
sendProposalFixture({int proposalId = 1, int totalZat = 100500, int feeZat = 500, int changeZat = 0, bool hasTransparentRecipient = false, bool isShield = false, bool isTwoStepTex = false, List<ProposalStep>? steps, LargeSendReason? largeSend, bool selfSend = false, int? singleRecipientZat = 100000, Uint8List? binding}) → SendProposal
A neutral SendProposal for tests — override only what a case cares about. Defaults to a single shielded (Orchard) recipient (no de-shield disclosure).
shieldProposalFixture({int proposalId = 42, int totalZat = 500000, int feeZat = 15000}) → SendProposal
A neutral SHIELD SendProposal for Recv-3 tests — isShield == true, NO transparent recipient (privacy-positive), gross/fee/net consistent (changeZat == totalZat - feeZat), the lone output in the shielded pool.
swapQuoteFixture({String id = 'swap-1', String depositAddress = 'tdeposit', String? depositMemo, int expiresAt = 2000000000, String amountIn = '0.5', String minAmountOut = '49.5', int zecSideZat = 50000000, String? refundTo, bool deshields = true, bool endsShielded = false, bool providerLegsTransparent = true, List<DisclosureItem> providerSees = const [DisclosureItem.amounts, DisclosureItem.destinationAddress], Uint8List? binding}) → SwapQuote
A neutral SwapQuote for tests — override only what a case cares about. Defaults to an OutOfZec-shaped quote (a de-shielding deposit) so the disclosure carries the privacy-critical flags a swap review must render.
swapRecordFixture({String id = 'swap-record-1', SwapRecordDirection direction = SwapRecordDirection.outOfZec, int createdAt = 1700000000, int? depositDeadline = 4100000000, int expiresAt = 4100172800, SwapOutcome? outcome}) → SwapRecord
A durable in-flight swap row (W-swap-5, #366) — drives the wallet-screen swap home + the guard-fault "view swap" re-attach. Defaults to OutOfZec (the armed-deposit shape the hardware photo showed invisible).
swapTokenListFixture({List<SwapToken>? tokens, bool fresh = true}) → SwapTokenList
A neutral SwapTokenList for IntoZec picker tests — two plausible source assets, fresh by default. Override fresh: false to model serve-stale, or tokens: const [] (fresh) to model the honest "no assets available" state.
txSummaryFixture({String txidHex = 'aa00000000000000000000000000000000000000000000000000000000000000', int? minedHeight = 100, TxStatus status = const TxStatus.confirmed(depth: 5), int netAmountZat = 250000, int? feeZat, bool hasMemo = true, bool hasTransparentOutput = false, int? timestamp = 1700000000}) → TxSummary
A neutral TxSummary history row for tests (FR-1) — override only what a case cares about. Defaults to a confirmed incoming tx with a memo.
walletStateFixture({SyncStatus syncStatus = const SyncStatus.idle(), TorState tor = const TorState.off(), BalanceSnapshot? balance, int? tip, SyncStamp? lastSynced, bool everSynced = false, bool rescanRebuilding = false, int seq = 0}) → WalletState
A complete, neutral WalletState for tests — override only what a case cares about. PlatformInt64 is int on the host VM (web is out of scope for this SDK), so plain int literals construct the money fields.