FakeSendAuthorizer class

A recording WalletSendAuthorizer for host-VM tests — proves the seam's contract from the outside: every money-committing action routes through authorizeSpend EXACTLY ONCE (see intents), and a denial (denyAll) reaches the controller BEFORE any bridge call (pair with the fake session's call counters).

Implemented types

Constructors

FakeSendAuthorizer({bool denyAll = false, Future<void> prompt(WalletSpendIntent intent)?})

Properties

denyAll ↔ bool
When true, every authorizeSpend throws WalletSpendAuthorizationDenied WITHOUT running the action — the user dismissing the host's prompt.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
intents → List<WalletSpendIntent>
Every intent authorized (or denied), in order — asserting on its length pins the exactly-once invariant; on its kind/amountZat, the prompt facts the host would render.
final
prompt ↔ Future<void> Function(WalletSpendIntent intent)?
When set, AWAITED first (after recording the intent) — the call PARKS at the "host prompt" so a test can interleave events (a session swap, a second action) before the outcome lands (#330 harness). Called per authorization, so a test can gate calls selectively; it may itself throw WalletSpendAuthorizationDenied to deny just that call. On normal completion the call proceeds to denyAll/throwBeforeAction/the action.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
throwBeforeAction ↔ Object?
When set, every authorizeSpend throws THIS (after recording the intent) without running the action — a host authorizer whose own credential step failed (NOT a user cancel). The controllers must classify it like a real failure, with zero bridge calls made.
getter/setter pair

Methods

authorizeSpend<T>(WalletSpendIntent intent, Future<T> action()) → Future<T>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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