Skip to content

Commit

Permalink
fix up docs and remove unnecessary pub main
Browse files Browse the repository at this point in the history
  • Loading branch information
nategraf committed Jan 10, 2025
1 parent 61e4f9e commit f634403
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aggregation/guest/set-builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn verify_state(state: &GuestState) {
env::verify(state.self_image_id, &state.encode()).unwrap();
}

pub fn main() {
fn main() {
// Read the input and verify the given state.
let input: GuestInput = env::read();
verify_state(&input.state);
Expand Down
8 changes: 4 additions & 4 deletions aggregation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ impl GuestState {
self.mmr.is_empty()
}

/// Encodes the [GuestOutput] for committing to the journal. Uses a specialized codec.
/// 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()
}

/// Decodes the [GuestOutput] for the journal. Uses a specialized codec.
/// Decodes the [GuestState] for the journal. Uses a specialized codec.
/// See [MerkleMountainRange::encode].
pub fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, DecodingError> {
// Read the first 32 bytes as the self_image_id.
Expand All @@ -116,11 +116,11 @@ impl GuestState {
Ok(Self { self_image_id, mmr })
}

/// Create a [GuestInput] from this [GuestOutput]. When run with the guest, the given claims
/// Create a [GuestInput] from this [GuestState]. When run with the guest, the given claims
/// will be accumulated into the Merkle mountain range, and will be finalized if `finalize` is
/// set to `true`.
///
/// Will return an error if the [MerkleMountainRange] on the [GuestOutput] is already
/// Will return an error if the [MerkleMountainRange] on the [GuestState] is already
/// finalized, as no more claims may be added and the guest would reject this input.
pub fn into_input(
self,
Expand Down

0 comments on commit f634403

Please sign in to comment.