clvm_utils/lib.rs
1//! # CLVM Utils
2//! This provides various commonly needed utilities for working with CLVM values.
3//!
4//! ## Currying Example
5//!
6//! ```rust
7//! use clvm_utils::CurriedProgram;
8//! use clvm_traits::{ToClvm, clvm_curried_args};
9//! use clvmr::{Allocator, serde::node_to_bytes};
10//!
11//! let a = &mut Allocator::new();
12//!
13//! let program = a.one();
14//!
15//! let ptr = CurriedProgram {
16//! program,
17//! args: clvm_curried_args!(42, 75),
18//! }
19//! .to_clvm(a)
20//! .unwrap();
21//!
22//! let hex = hex::encode(node_to_bytes(a, ptr).unwrap());
23//!
24//! // (a (q . 1) (c (q . 42) (c (q . 75) 1)))
25//! assert_eq!(hex, "ff02ffff0101ffff04ffff012affff04ffff014bff01808080");
26
27mod curried_program;
28mod curry_tree_hash;
29mod hash_encoder;
30mod tree_hash;
31
32pub use curried_program::*;
33pub use curry_tree_hash::*;
34pub use hash_encoder::*;
35pub use tree_hash::*;