Skip to main content

miden_protocol/block/
block_proof.rs

1use crate::utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable};
2
3/// Represents a proof of a block in the chain.
4///
5/// NOTE: Block proving is not yet implemented. This is a placeholder struct.
6#[derive(Debug, Clone, PartialEq, Eq)]
7pub struct BlockProof {}
8
9impl BlockProof {
10    /// Creates a dummy `BlockProof` for testing purposes only.
11    #[cfg(any(test, feature = "testing"))]
12    pub fn new_dummy() -> Self {
13        Self {}
14    }
15}
16
17// SERIALIZATION
18// ================================================================================================
19
20impl Serializable for BlockProof {
21    fn write_into<W: ByteWriter>(&self, _target: &mut W) {
22        // TODO: Implement serialization for BlockProof when fields exist.
23    }
24}
25
26impl Deserializable for BlockProof {
27    fn read_from<R: ByteReader>(_source: &mut R) -> Result<Self, DeserializationError> {
28        // TODO: Implement deserialization for BlockProof when fields exist.
29        let block = Self {};
30
31        Ok(block)
32    }
33}