FakeOnboardingStore class

An in-memory OnboardingStore. Backs the backup-confirmed flag; can be made to throw on persist to exercise the gate-stays-closed path. Seedable so a "previous launch" state (a confirmed or unconfirmed prior wallet) is set up.

Implemented types

Constructors

FakeOnboardingStore({bool? confirmed})

Properties

deepScanNote ↔ DeepScanRestoreNoteState
The #390 post-restore note lifecycle — seedable so a test can model a "previous launch" restored-and-pending or already-done wallet.
getter/setter pair
failGet ↔ Object?
When set, isBackupConfirmed throws (a degraded prefs read on boot) — so a test can prove the controller reads the flag BEFORE opening the wallet (a failed read must not leave an opened-then-orphaned handle holding the lock).
getter/setter pair
failSet ↔ Object?
When set, setBackupConfirmed throws (a prefs write failing). The stored value is left UNCHANGED so the test can assert the gate stayed closed.
getter/setter pair
failSetTrue ↔ Object?
When set, setBackupConfirmed throws ONLY on the confirmed: true write — so a restore test can let the crash-safe false gate-close succeed, the wallet restore succeed, then fail just the confirm-open persist (the "restored but confirmation didn't survive → hold at forced backup" path).
getter/setter pair
getCount ↔ int
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
holdNoteSet ↔ Completer<void>?
Mirrors holdSet for the #390 note write: when set, setDeepScanRestoreNoteState blocks on this BEFORE mutating the flag — so a test can prove the controller AWAITS the note write BEFORE it flips the session to OnboardingActive.
getter/setter pair
holdSet ↔ Completer<void>?
When set, setBackupConfirmed blocks on this until completed BEFORE it mutates the flag — mirroring FakeWalletProvisioner.holdOpen. Lets a test dispose the container WHILE a confirm/create-reset persist is in flight, then release the gate and assert no post-dispose state = throws (the _disposed guard after the await must swallow the continuation).
getter/setter pair
lastSetValue ↔ bool?
getter/setter pair
noteSetCount ↔ int
getter/setter pair
persisted → bool?
Direct peek for assertions — what the persisted flag currently is.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
setCount ↔ int
getter/setter pair
trueSetCount ↔ int
How many times the gate was OPENED (a confirmed: true write) vs CLOSED (the create-time false write). setCount counts both, so a money test that wants "the confirmation persisted exactly once" asserts on this — a double-tap that double-activated would push it above 1.
getter/setter pair

Methods

deepScanRestoreNoteState() → Future<DeepScanRestoreNoteState>
The #390 post-restore deep-scan note's lifecycle for the wallet currently on disk. notApplicable when unknown/unset (fail-safe: a wallet whose provenance we can't read gets NO note). This is a durable provenance + acknowledgement fact — the same host-UX category as isBackupConfirmed, NOT wallet/crypto state (design invariant 1); it stores NO secret.
override
isBackupConfirmed() → Future<bool>
Whether the user has confirmed the recovery-phrase backup for the wallet currently on disk. false when unknown/unset (fail-safe).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setBackupConfirmed({required bool confirmed}) → Future<void>
Set the confirmed flag. true is recorded only after an explicit confirm; false resets the gate for a fresh wallet at create-start. Must DURABLY persist before it resolves — the controller only goes deposit-ready after a true write completes, and only writes the new wallet after a false write completes (the crash-safe ordering).
override
setDeepScanRestoreNoteState(DeepScanRestoreNoteState state) → Future<void>
Persist the note lifecycle (written definitively at each activation — see OnboardingController). BEST-EFFORT: a failed write is non-fatal (the worst case is the one-time nudge not showing, the fail-safe direction), so unlike setBackupConfirmed this NEVER throws.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited