signet_sim/
outcome.rs

1use alloy::primitives::U256;
2use trevm::revm::database::Cache;
3
4use crate::SimItem;
5
6/// A simulation outcome that includes the score, gas used, and a cache of
7/// state changes.
8#[derive(Debug, Clone)]
9pub struct SimOutcomeWithCache {
10    /// The transaction or bundle that was simulated, as in the cache.
11    pub identifier: u128,
12
13    /// The score of the simulation, a [`U256`] value that represents the
14    /// increase in the beneficiary's balance.
15    pub score: U256,
16
17    /// The result of the simulation, a [`Cache`] containing state changes that
18    /// can be applied.
19    pub cache: Cache,
20
21    /// The total amount of gas used by the simulation.
22    pub gas_used: u64,
23}
24
25/// An item after simulation, containing the score and gas used.
26#[derive(Debug, Clone)]
27pub struct SimulatedItem {
28    /// The score of the simulation, a [`U256`] value that represents the
29    /// increase in the beneficiary's balance.
30    pub score: U256,
31
32    /// The total amount of gas used by the simulation.
33    pub gas_used: u64,
34
35    /// The transaction or bundle that was simulated.
36    pub item: SimItem,
37}