pub fn simulate_invoke_host_function_op(
    snapshot_source: Rc<dyn SnapshotSource>,
    network_config: Option<NetworkConfig>,
    adjustment_config: &SimulationAdjustmentConfig,
    ledger_info: &LedgerInfo,
    host_fn: HostFunction,
    auth_entries: Option<Vec<SorobanAuthorizationEntry>>,
    source_account: &AccountId,
    base_prng_seed: [u8; 32],
    enable_diagnostics: bool,
) -> Result<InvokeHostFunctionSimulationResult>
Expand description

Simulates InvokeHostFunctionOp operation specified via its relevant payload parts.

The operation is defined by the host function itself (host_fn) and optionally signed auth_entries. In case if auth_entries are omitted, the simulation will use recording authorization mode and return non-signed recorded authorization entries.

The rest of parameters define the ledger state (snapshot_source, network_config, ledger_info), simulation adjustment configuration (adjustment_config), and transaction execution parameters (source_account, base_prng_seed).

enable_diagnostics enables recording of diagnostic_events in the response.

This function makes the best effort at returning non-Err result even for failed invocations. It should only fail if ledger is mis-configured (e.g. when computed fees cause overflows).