SandboxLayer class

LAYER 3 — Simulates execution against mock state, without ever touching a real database.

Acts as a "dry-run validator": it checks whether the requested transaction would succeed against a mock balance/rule set, and rejects it early if it obviously couldn't (e.g. insufficient funds). This lets the pipeline catch invalid transactions cheaply, before any real backend call is ever made.

Implemented types

Constructors

SandboxLayer({Map<String, double>? mockBalances, double maxTransactionAmount = 10000})
Creates a sandbox layer, seeding demo balances when mockBalances is not provided.

Properties

hashCode → int
The hash code for this object.
no setterinherited
maxTransactionAmount → double
Mock per-user transaction ceiling, simulating a business rule.
final
mockBalances → Map<String, double>
Mock balances keyed by userId, simulating account state.
final
name → String
A short, stable, human-readable name used in logs and results.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

check(RequestContext context) → Future<SecurityResult>
Inspects context and returns a SecurityResult.
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