diff --git a/crates/chain/src/chain_data.rs b/crates/chain/src/chain_data.rs index 16877637..c5de09bb 100644 --- a/crates/chain/src/chain_data.rs +++ b/crates/chain/src/chain_data.rs @@ -87,6 +87,9 @@ impl From> for ConfirmationTime { } /// A reference to a block in the canonical chain. +/// +/// `BlockId` implements [`Anchor`]. When a transaction is anchored to `BlockId`, the confirmation +/// block and anchor block are the same block. #[derive(Debug, Clone, PartialEq, Eq, Copy, PartialOrd, Ord, core::hash::Hash)] #[cfg_attr( feature = "serde", @@ -100,6 +103,12 @@ pub struct BlockId { pub hash: BlockHash, } +impl Anchor for BlockId { + fn anchor_block(&self) -> Self { + *self + } +} + impl Default for BlockId { fn default() -> Self { Self {