referrerpolicy=no-referrer-when-downgrade

run

Function run 

Source
pub fn run(program: &[u8])
Expand description

Run every test that uses only the public forwarder API.

Exported as a regular function so it can be invoked from both:

  • the runtime (compiled into sc-runtime-test) — exercises the wasm/forwarder path end-to-end, including the host-function FFI;
  • native host tests (in sc-virtualization) — exercises the host-side dispatch directly.

Tests that need pre-populated externalities (storage fallback for compile_from_storage_key) can’t run from a runtime context and live as standalone #[test]s in sc-virtualization.

The program needs to be set to sp_virtualization_test_fixture::binary(). It can’t be hard coded because when this crate is compiled into a runtime the binary is not available. Instead, we pass it as an argument to the runtime exported function.