MCPcopy Create free account
hub / github.com/cowprotocol/services / simulation_report

Method simulation_report

crates/simulator/src/simulation_builder.rs:484–508  ·  view source on GitHub ↗

Runs the simulation together with a call tracer. Afterwards the call trace gets analyzed to generate a high level report of the simulation with information to help the caller understand what went wrong during the simulation.

(
        &self,
    )

Source from the content-addressed store, hash-verified

482 /// with information to help the caller understand what went wrong during
483 /// the simulation.
484 pub async fn simulation_report(
485 &self,
486 ) -> Result<report::SimulationReport, RpcError<alloy_transport::TransportErrorKind>> {
487 let trace_options = GethDebugTracingCallOptions::default()
488 .with_tracing_options(GethDebugTracingOptions::call_tracer(CallConfig::default()))
489 .with_state_overrides(self.state_overrides.clone());
490 let trace = self
491 .simulator
492 .0
493 .provider
494 .clone()
495 .debug_trace_call_callframe(
496 self.as_transaction_request(),
497 self.block.into(),
498 trace_options,
499 )
500 .await?;
501
502 let context = report::Context {
503 settlement: self.simulator.0.settlement.address(),
504 vault_relayer: &self.simulator.0.vault_relayer,
505 trampoline: &self.simulator.0.hooks_trampoline,
506 };
507 Ok(report::generate_settlement_report(context, trace))
508 }
509
510 /// Same as [`EthCallInputs::simulate`] but also generates a tenderly
511 /// request in case one wants to re-simulate with tenderly. If tenderly

Callers 1

analyze_simulationFunction · 0.80

Calls 5

cloneMethod · 0.45
intoMethod · 0.45
addressMethod · 0.45

Tested by

no test coverage detected