Skip to content

Commit

Permalink
[Docs] Document lazy init in Tipset/FullTipset. (#4324)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruseinov authored May 14, 2024
1 parent 9046c1c commit ae1f1f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/blocks/tipset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ impl IntoIterator for TipsetKey {
pub struct Tipset {
/// Sorted
headers: NonEmpty<CachingBlockHeader>,
// key is lazily initialized via `fn key()`.
key: OnceCell<TipsetKey>,
}

Expand Down Expand Up @@ -405,10 +406,11 @@ impl Tipset {
}

/// `FullTipset` is an expanded version of a tipset that contains all the blocks
/// and messages
/// and messages.
#[derive(Debug, Clone)]
pub struct FullTipset {
blocks: NonEmpty<Block>,
// key is lazily initialized via `fn key()`.
key: OnceCell<TipsetKey>,
}

Expand Down

0 comments on commit ae1f1f4

Please sign in to comment.