data_anchor_api/
lib.rs

1#![doc = include_str!("../README.md")]
2
3use data_anchor_proofs::compound::{
4    completeness::CompoundCompletenessProof, inclusion::CompoundInclusionProof,
5};
6use serde::{Deserialize, Serialize};
7
8mod indexing;
9mod rpc;
10
11pub use indexing::*;
12pub use rpc::*;
13
14/// A compound proof that proves whether a blob has been published in a specific slot.
15/// See [`CompoundInclusionProof`] and [`CompoundCompletenessProof`] for more information.
16#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
17pub enum CompoundProof {
18    /// See [`CompoundInclusionProof`].
19    Inclusion(CompoundInclusionProof),
20    /// See [`CompoundCompletenessProof`].
21    Completeness(CompoundCompletenessProof),
22}
23
24impl CompoundProof {
25    /// Returns if the proof is an inclusion proof.
26    pub fn is_inclusion(&self) -> bool {
27        matches!(self, CompoundProof::Inclusion(_))
28    }
29}