pub enum DiscoveryFilter {
ProgramExecuted(Address),
OracleUpdate {
programs: BTreeSet<Address>,
accounts: BTreeSet<Address>,
},
}Expand description
A filter registered at session creation describing which upcoming batches
the session should announce ahead of execution via
BacktestResponse::DiscoveryBatch (and its session-event twins). Each
filter describes an event of interest (e.g. a specific program executing);
the session “discovers” the batch in which that event will occur and
emits a DiscoveryBatch so the client can pause immediately before it.
Variants§
ProgramExecuted(Address)
Discover batches containing a transaction that invokes this program.
OracleUpdate
Discover batches containing a market maker’s write to its pricing state: a transaction
that invokes one of programs, moves no token balance and, unless accounts is empty,
writes one of accounts. Besides price updates this also matches the maker’s other
token-free writes, such as configuration.
Implementations§
Source§impl DiscoveryFilter
impl DiscoveryFilter
Sourcepub fn matches(&self, ctx: &TxMatchContext) -> bool
pub fn matches(&self, ctx: &TxMatchContext) -> bool
Return true when this filter is satisfied by the transaction
described by ctx.