Skip to main content

miden_objects/
lib.rs

1#![no_std]
2
3extern crate alloc;
4
5pub mod conversion;
6pub mod decoded;
7pub mod error;
8
9#[cfg(test)]
10pub(crate) mod test_utils;
11
12pub use error::{ConversionError, ConversionResultExt};
13pub use miden_protobuf::{BuildUnchecked, DecodeMessage, Decoded, Verify, VerifyWith};
14pub use prost;
15
16/// Generated canonical Protobuf messages.
17pub mod proto {
18    pub mod account {
19        include!(concat!(env!("OUT_DIR"), "/account.rs"));
20    }
21
22    pub mod asset {
23        include!(concat!(env!("OUT_DIR"), "/asset.rs"));
24    }
25
26    pub mod blockchain {
27        include!(concat!(env!("OUT_DIR"), "/blockchain.rs"));
28    }
29
30    pub mod note {
31        include!(concat!(env!("OUT_DIR"), "/note.rs"));
32    }
33
34    pub mod primitives {
35        include!(concat!(env!("OUT_DIR"), "/primitives.rs"));
36    }
37
38    pub mod protocol_config {
39        include!(concat!(env!("OUT_DIR"), "/protocol_config.rs"));
40    }
41
42    pub mod transaction {
43        include!(concat!(env!("OUT_DIR"), "/transaction.rs"));
44    }
45}
46
47/// Self-contained descriptor set for the canonical object schemas.
48pub const FILE_DESCRIPTOR_SET: &[u8] =
49    include_bytes!(concat!(env!("OUT_DIR"), "/miden_objects_descriptor.bin"));
50
51/// Protobuf paths and their canonical generated Rust paths.
52///
53/// Service-binding build scripts should configure these as Prost external paths so that messages
54/// imported from this descriptor are represented by this crate's generated Rust types.
55pub const EXTERN_PATHS: &[(&str, &str)] = &[
56    (".account", "::miden_objects::proto::account"),
57    (".asset", "::miden_objects::proto::asset"),
58    (".blockchain", "::miden_objects::proto::blockchain"),
59    (".note", "::miden_objects::proto::note"),
60    (".primitives", "::miden_objects::proto::primitives"),
61    (".protocol_config", "::miden_objects::proto::protocol_config"),
62    (".transaction", "::miden_objects::proto::transaction"),
63];