ex3_node_types/block/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#![allow(unused_imports)]

use candid::CandidType;
use serde::{Deserialize, Serialize};

pub use body::*;
pub use header::*;

mod body;
mod header;

#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub struct Block {
    pub head: BlockHeader,
    pub body: Option<BlockBody>,
}

#[derive(Debug, CandidType, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub enum DaType {
    ARWave,
    Celestia,
    IPFS,
}

#[derive(Debug, CandidType, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub struct BlockDataAvailability {
    /// Data Availability Type
    pub r#type: DaType,

    /// Data Availability Reference
    ///
    /// Note: This is a reference to the data availability, may be a CID, a hash, etc.
    pub da_ref: Vec<u8>,
}