Skip to main content

tamper

Function tamper 

Source
pub fn tamper<S: Store>(
    store: &S,
    nth: usize,
    edit: impl FnOnce(&mut Vec<u8>),
) -> Result<bool>
Expand description

Fault injection (tests and the gym): rewrite the payload of the nth record in the log (0-based, from offset 0) with edit, keeping its prev and recomputing its CRC, as someone editing the file would. The chain then breaks at the record after it (I18). False if there is no such record or the edit changes the payload’s length.