INNER CODE UNIT · Rust
initial
risc0/risc0-ethereum · crates/aggregation/src/lib.rs:88
pub fn initial(self_image_id: impl Into<Digest>) -> Self {
Self {
self_image_id: self_image_id.into(),
mmr: MerkleMountainRange::empty(),
}
}
/// Returns true if this is the initial state, for an empty claim set.
pub fn is_initial(&self) -> bool {
self.mmr.is_empty()
}
/// Encodes the [GuestState] for committing to the journal. Uses a specialized codec.
/// See [MerkleMountainRange::encode].
pub fn encode(&self) -> Vec<u8> {
[self.self_image_id.as_bytes(), &self.mmr.encode()].concat()
}