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
14mod accessors;
15
16#[cfg(feature = "solana-types")]
17pub mod convert;
18
19#[cfg(test)]
20mod tests {
21    use crate::{protos, VERSION};
22
23    #[test]
24    fn can_create_txn() {
25        let txn = protos::SanitizedTransaction {
26            ..Default::default()
27        };
28        assert_eq!(
29            txn,
30            protos::SanitizedTransaction {
31                ..Default::default()
32            }
33        );
34    }
35
36    #[test]
37    fn exports_crate_version() {
38        assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
39    }
40}