diff --git a/src/dag/resolvers/st.rs b/src/dag/resolvers/st.rs index 63287fe..68fa692 100644 --- a/src/dag/resolvers/st.rs +++ b/src/dag/resolvers/st.rs @@ -12,7 +12,7 @@ use crate::{ awaiters::ImmediateAwaiter, primitives::{Metadata, OrderIx, ResolverIx, Values}, resolver_box::{invocation_binder, Resolver, ResolverBox}, - CircuitResolver, CircuitResolverOpts, WitnessSource, WitnessSourceAwaitable, + CircuitResolver, WitnessSource, WitnessSourceAwaitable, }, field::SmallField, utils::PipeOp as _, @@ -22,6 +22,20 @@ pub struct StCircuitResolverParams { pub max_variables: usize, } +impl From for StCircuitResolverParams { + fn from(value: usize) -> Self { + Self::new(value) + } +} + +impl StCircuitResolverParams { + pub fn new(max_variables: usize) -> Self { + Self { max_variables } + } +} + + + #[derive(Default)] struct Stats { resolvers_added: u32, @@ -31,7 +45,7 @@ pub struct StCircuitResolver { values: Values, deferrer: Deferrer, resolver_box: ResolverBox, - options: CircuitResolverOpts, + options: StCircuitResolverParams, stats: Stats, phantom: PhantomData, } @@ -227,7 +241,7 @@ impl StCircuitResolver { } impl CircuitResolver for StCircuitResolver { - type Arg = CircuitResolverOpts; + type Arg = StCircuitResolverParams; fn new(opts: Self::Arg) -> Self { let values = Values { @@ -316,6 +330,7 @@ impl Deferrer { #[cfg(test)] mod test { use crate::dag::*; + use crate::dag::resolvers::StCircuitResolverParams; use crate::{ config::{CSConfig, DevCSConfig}, cs::{traits::cs::DstBuffer, Place}, @@ -334,7 +349,7 @@ mod test { #[test] fn resolves_init() { - let mut resolver = StCircuitResolver::::new(CircuitResolverOpts::new(111)); + let mut resolver = StCircuitResolver::::new(StCircuitResolverParams::new(111)); let res_fn = |ins: &[F], outs: &mut DstBuffer| { outs.push(ins[0]); @@ -350,7 +365,7 @@ mod test { #[test] fn resolves_chain() { - let mut resolver = StCircuitResolver::::new(CircuitResolverOpts::new(111)); + let mut resolver = StCircuitResolver::::new(StCircuitResolverParams::new(111)); let res_fn = |ins: &[F], outs: &mut DstBuffer| { outs.push(ins[0]); @@ -367,7 +382,7 @@ mod test { #[test] fn resolves_delayed_set() { - let mut resolver = StCircuitResolver::::new(CircuitResolverOpts::new(111)); + let mut resolver = StCircuitResolver::::new(StCircuitResolverParams::new(111)); let res_fn = |ins: &[F], outs: &mut DstBuffer| { outs.push(ins[0]);