Skip to main content

protosol/
lib.rs

1pub mod protos {
2    include!("generated/org.solana.sealevel.v1.rs");
3}
4
5/// Version of the `protosol` crate, sourced from Cargo package metadata.
6pub const VERSION: &str = env!("CARGO_PKG_VERSION");
7
8/// Pre-compiled FileDescriptorSet for all protobuf definitions.
9///
10/// This binary blob can be loaded by reflection libraries (e.g. prost-reflect's
11/// `DescriptorPool::decode`) to inspect message schemas at runtime.
12pub const FILE_DESCRIPTOR_SET_BYTES: &[u8] = include_bytes!("generated/file_descriptor_set.bin");
13
14#[cfg(feature = "solana-types")]
15pub mod convert;
16
17#[cfg(test)]
18mod tests {
19    use crate::{protos, VERSION};
20
21    #[test]
22    fn can_create_txn() {
23        let txn = protos::SanitizedTransaction {
24            ..Default::default()
25        };
26        assert_eq!(
27            txn,
28            protos::SanitizedTransaction {
29                ..Default::default()
30            }
31        );
32    }
33
34    #[test]
35    fn exports_crate_version() {
36        assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
37    }
38}