diff --git a/halo2_proofs/src/circuit.rs b/halo2_proofs/src/circuit.rs index 254c08ff84..1dc9bd917f 100644 --- a/halo2_proofs/src/circuit.rs +++ b/halo2_proofs/src/circuit.rs @@ -12,6 +12,7 @@ use crate::{ }; mod value; +pub(crate) use value::value_dev; pub use value::Value; pub mod floor_planner; diff --git a/halo2_proofs/src/circuit/value.rs b/halo2_proofs/src/circuit/value.rs index ca31dffda9..1a1bf4f9a2 100644 --- a/halo2_proofs/src/circuit/value.rs +++ b/halo2_proofs/src/circuit/value.rs @@ -701,3 +701,10 @@ impl Value> { } } } + +/// Utilities for tests and dev tools. +pub mod value_dev { + pub fn unwrap_value(v: super::Value) -> T { + v.inner.unwrap() + } +} diff --git a/halo2_proofs/src/dev.rs b/halo2_proofs/src/dev.rs index a020d4c874..cdd1c450b4 100644 --- a/halo2_proofs/src/dev.rs +++ b/halo2_proofs/src/dev.rs @@ -51,6 +51,8 @@ mod graph; #[cfg_attr(docsrs, doc(cfg(feature = "dev-graph")))] pub use graph::{circuit_dot_graph, layout::CircuitLayout}; +pub use crate::circuit::value_dev::unwrap_value; + #[derive(Debug)] struct Region { /// The name of the region. Not required to be unique.