MCPcopy Create free account
hub / github.com/BitVM/BitVM / commit

Method commit

header-chain/src/zkvm.rs:44–49  ·  view source on GitHub ↗
(&self, item: &T)

Source from the content-addressed store, hash-verified

42 }
43
44 fn commit<T: borsh::BorshSerialize>(&self, item: &T) {
45 // use risc0_zkvm::guest::env::Write as _;
46 let buf = borsh::to_vec(item).expect("Serialization to vec is infallible");
47 let mut journal = env::journal();
48 journal.write_all(&buf).unwrap();
49 }
50
51 fn verify<T: borsh::BorshSerialize>(&self, method_id: [u32; 8], output: &T) {
52 env::verify(method_id, &borsh::to_vec(output).unwrap()).unwrap();

Callers 1

header_chain_circuitFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected