Function commit

Source
pub fn commit<T>(value: &T)
where T: Serialize,
Expand description

Commit a serializable object to the public values stream.

§Examples

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
struct MyStruct {
    a: u32,
    b: u32,
}

let data = MyStruct {
    a: 1,
    b: 2,
};
sp1_zkvm::io::commit(&data);