Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fixes: default witness, removed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lancenonce committed Jul 28, 2023
1 parent db50d0f commit 0f32f6f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/wit_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ pub struct TraceContext<F> {
num_steps: usize,
}

impl<F> TraceContext<F> {
impl<F: Default> TraceContext<F> {
pub fn new(num_steps: usize) -> Self {
Self {
witness: TraceWitness {
step_instances: Vec::new(),
},
witness: TraceWitness::default(),
num_steps,
}
}
Expand All @@ -60,7 +58,7 @@ impl<F> TraceContext<F> {
}
}

impl<F: Clone> TraceContext<F> {
impl<F> TraceContext<F> {
pub fn add<Args, WG: Fn(&mut StepInstance<F>, Args) + 'static>(
&mut self,
step: &StepTypeWGHandler<F, Args, WG>,
Expand Down Expand Up @@ -179,7 +177,7 @@ mod tests {
let step = StepTypeWGHandler::new(
uuid(),
"dummy",
|_: &mut StepInstance<i32>, _: ()| {}, // replace i32 with your Field type
|_: &mut StepInstance<i32>, _: ()| {},
);

assert_eq!(ctx.witness.step_instances.len(), 0);
Expand All @@ -194,7 +192,7 @@ mod tests {
let step = StepTypeWGHandler::new(
uuid(),
"dummy",
|_: &mut StepInstance<i32>, _: ()| {}, // replace i32 with your Field type
|_: &mut StepInstance<i32>, _: ()| {},
);

dummy_args_fn();
Expand Down

0 comments on commit 0f32f6f

Please sign in to comment.