Skip to main content

ReplayPolicy

Trait ReplayPolicy 

Source
trait ReplayPolicy<FEN: FoundryEvmNetwork> {
    type Outcome: Clone;

    // Required methods
    fn accumulate_warp_roll(&self) -> bool;
    fn on_call(
        &self,
        calls: &[BasicTxDetails],
        sequence: &[usize],
        idx: usize,
        call_result: RawCallResult<FEN>,
        counters: &mut ReplayCounters,
    ) -> Option<Self::Outcome>;
    fn finish(
        &self,
        executor: &mut Executor<FEN>,
        counters: &ReplayCounters,
    ) -> Result<Self::Outcome>;

    // Provided method
    fn before_call(
        &self,
        _executor: &mut Executor<FEN>,
        _sequence: &[usize],
        _idx: usize,
    ) -> Result<()> { ... }
}
Expand description

What a sequence replay does with each kept call and with the final state.

Required Associated Types§

Required Methods§

Source

fn accumulate_warp_roll(&self) -> bool

Whether warp/roll of removed calls is folded into the next kept call.

Source

fn on_call( &self, calls: &[BasicTxDetails], sequence: &[usize], idx: usize, call_result: RawCallResult<FEN>, counters: &mut ReplayCounters, ) -> Option<Self::Outcome>

Classifies one replayed call of sequence. Returns the outcome when the call stops the replay. The decision for a call that is not the last kept call must not depend on the calls after it, because PrefixReplay reuses it for later candidates.

Source

fn finish( &self, executor: &mut Executor<FEN>, counters: &ReplayCounters, ) -> Result<Self::Outcome>

Builds the outcome once every kept call ran.

Provided Methods§

Source

fn before_call( &self, _executor: &mut Executor<FEN>, _sequence: &[usize], _idx: usize, ) -> Result<()>

Prepares executor to run the kept call idx of sequence. An error stops the replay.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§