1use strict_types::{CompileError, LibBuilder, TypeLib};
23
24use crate::{mpc, MerkleHash, MerkleNode, ReservedBytes, StrictHash, LIB_NAME_COMMIT_VERIFY};
25
26pub const LIB_ID_COMMIT_VERIFY: &str =
27 "stl:TGUWcCPX-99GBEi0-tlbMxUg-1SS_~Qh-_IdYDJt-zjJ3uMI#violet-panther-herbert";
28
29fn _commit_verify_stl() -> Result<TypeLib, CompileError> {
30 LibBuilder::with(libname!(LIB_NAME_COMMIT_VERIFY), [
31 strict_types::stl::std_stl().to_dependency_types()
32 ])
33 .transpile::<ReservedBytes<1>>()
34 .transpile::<ReservedBytes<2>>()
35 .transpile::<ReservedBytes<4>>()
36 .transpile::<mpc::MerkleConcealed>()
37 .transpile::<mpc::MerkleTree>()
38 .transpile::<mpc::MerkleBlock>()
39 .transpile::<mpc::MerkleProof>()
40 .transpile::<mpc::Leaf>()
41 .transpile::<mpc::Commitment>()
42 .transpile::<MerkleNode>()
43 .transpile::<MerkleHash>()
44 .transpile::<StrictHash>()
45 .compile()
46}
47
48pub fn commit_verify_stl() -> TypeLib {
49 _commit_verify_stl().expect("invalid strict type CommitVerify library")
50}
51
52#[cfg(test)]
53mod test {
54 use super::*;
55
56 #[test]
57 fn lib_id() {
58 let lib = commit_verify_stl();
59 assert_eq!(lib.id().to_string(), LIB_ID_COMMIT_VERIFY);
60 }
61}