From e6aeaea0c69472e4c2dcf0f5e2f632f43733529d Mon Sep 17 00:00:00 2001 From: valued mammal Date: Thu, 12 Sep 2024 15:18:01 -0400 Subject: [PATCH] doc(core): document panic for `CheckPoint::insert` --- crates/core/src/checkpoint.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/core/src/checkpoint.rs b/crates/core/src/checkpoint.rs index 089db230..10af1327 100644 --- a/crates/core/src/checkpoint.rs +++ b/crates/core/src/checkpoint.rs @@ -171,6 +171,10 @@ impl CheckPoint { /// it. If the height already existed and has a conflicting block hash then it will be purged /// along with all block followin it. The returned chain will have a tip of the `block_id` /// passed in. Of course, if the `block_id` was already present then this just returns `self`. + /// + /// # Panics + /// + /// This panics if called with a genesis block that differs from that of `self`. #[must_use] pub fn insert(self, block_id: BlockId) -> Self { let mut cp = self.clone(); -- 2.49.0