(
&self,
order: &Order,
full_app_data: &str,
full_balance_check: bool,
)
| 78 | impl OrderSimulating for OrderCreationSimulator { |
| 79 | #[tracing::instrument(skip_all, fields(order_uid = %order.metadata.uid))] |
| 80 | async fn simulate( |
| 81 | &self, |
| 82 | order: &Order, |
| 83 | full_app_data: &str, |
| 84 | full_balance_check: bool, |
| 85 | ) -> Result<SimulationSuccess, OrderSimulationError> { |
| 86 | let inputs = self |
| 87 | .prepare_simulation(order, full_app_data, full_balance_check) |
| 88 | .await?; |
| 89 | |
| 90 | // Generating a failure report is more costly than a standard simulation. |
| 91 | // To avoid unnecessary overhead in the happy path we assume orders are |
| 92 | // well behaved and do a regular simulation by default. Except when it's |
| 93 | // an EIP 1271 order in which case we always have to run the more complex |
| 94 | // code to figure out how much gas the signature check needs. |
| 95 | if !matches!(order.signature, Signature::Eip1271(_)) && inputs.simulate().await.is_ok() { |
| 96 | return Ok(SimulationSuccess { |
| 97 | eip1271_signature_verification_gas: 0, |
| 98 | }); |
| 99 | } |
| 100 | |
| 101 | analyze_simulation(order, inputs).await |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | impl OrderCreationSimulator { |
no test coverage detected