Skip to main content

create_via_reducer

Function create_via_reducer 

Source
pub(crate) async fn create_via_reducer(
    state: &AppState,
    cmd: Command,
    refused: &str,
    missing: &str,
    apply: &str,
) -> Result<String, String>
Expand description

Run a command that creates a block and return the new block’s id: the reducer’s refusal is the error, the events are written to the store (a write that fails is logged and the open goes on, as every caller did) and published. Each caller keeps its own words: a refusal reads “refused: <the reducer’s message>”, a reducer that answered without a block “missing emitted no BlockCreated”, and a failed write is logged as “apply mstore apply failed”.