1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! State change sink: lets tooling observe account changes as they commit,
//! without a second pass over live state.
//!
//! `ExecutedTx` records the per-address before/after deltas at staging time
//! (see [`AccountChangeRecord`]) and streams them through a [`StateChangeSink`]
//! during [`ExecutedTx::commit_with`](crate::ExecutedTx::commit_with). The
//! changes are owned by the staged transaction, so streaming them never
//! re-reads the overlay.
use AccountSharedData;
use Address;
/// A single account's before/after state across one transaction.
///
/// `before` is `None` when the account did not exist in the overlay before
/// staging; `after` is `None` when the account was removed by the transaction.
/// Owned record of an account change, retained by a staged transaction.
/// Observer for state changes committed by a transaction.
///
/// Implementations receive each journaled account change exactly once, in
/// staging order, before the commit is finalized. Returning `Err` from any
/// hook aborts the commit and rolls the staged state back.