State
How state is represented, snapshotted, diffed, and reset.
State is the complete set of account balances, nonces, code, and storage in an environment at a given block. NOME treats state as an explicit, inspectable object rather than a side effect.
Snapshots
A snapshot captures all state and is identified by a content hash. Two snapshots with the same hash are guaranteed to be identical. Snapshots are created automatically before every run and can be created manually at any time.
nome env snapshot env_7f3a2c --label "post-deploy"Diffs
Every run produces a diff: an ordered list of writes with the previous and new value, the operation that caused the write, and the call frame it occurred in.
{
"run": "run_0419",
"from": "snap_0014",
"to": "snap_0015",
"writes": [
{ "account": "Vault", "slot": "totalAssets", "before": "500", "after": "750", "op": 2 },
{ "account": "Vault", "slot": "shares[user_1]", "before": "0", "after": "250", "op": 2 }
],
"balances": [
{ "account": "user_1", "asset": "USDX", "delta": "-250.000000" }
]
}Reset
Resetting an environment to a snapshot discards all state after that snapshot. Reset is exact and immediate regardless of how many runs occurred in between. Run records are retained for inspection even after reset.