1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! JSON serialization

use serde::{Deserialize, Serialize};

use ergotree_interpreter::sigma_protocol::prover::ProofBytes;

pub(crate) mod context_extension;
pub(crate) mod transaction;

/// Serde remote type
#[cfg_attr(
    feature = "json",
    derive(Serialize, Deserialize),
    serde(into = "String", try_from = "String"),
    serde(remote = "ProofBytes")
)]
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
pub enum ProofBytesSerde {
    /// Empty proof
    Empty,
    /// Non-empty proof
    Some(Vec<u8>),
}