Skip to content

Commit

Permalink
cargo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mason Liang committed Nov 7, 2023
1 parent 28a0446 commit bbda728
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 24 deletions.
4 changes: 1 addition & 3 deletions src/assignment_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ pub struct AssignmentMap<F: FieldExt>(BTreeMap<usize, Vec<(Column, Value<F>)>>);

impl<F: FieldExt> AssignmentMap<F> {
pub fn new(stream: impl ParallelIterator<Item = Assignment<F>>) -> Self {
let mut sorted_by_offset: Vec<_> = stream
.map(|a| (a.offset, a.column, a.value))
.collect();
let mut sorted_by_offset: Vec<_> = stream.map(|a| (a.offset, a.column, a.value)).collect();
sorted_by_offset.sort_by(|x, y| x.0.cmp(&y.0));
let grouped_by_offset = sorted_by_offset.iter().group_by(|(offset, _, _)| offset);
let y: BTreeMap<_, _> = grouped_by_offset
Expand Down
6 changes: 1 addition & 5 deletions src/gadgets/byte_bit.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use super::super::constraint_builder::{ConstraintBuilder, FixedColumn, Query};
use crate::assignment_map::{Assignment, Column};
use halo2_proofs::{
arithmetic::FieldExt,
circuit::{Region, Value},
plonk::ConstraintSystem,
};
use halo2_proofs::{arithmetic::FieldExt, circuit::Region, plonk::ConstraintSystem};
use rayon::prelude::*;

// TODO: fix name to configggggggg
Expand Down
15 changes: 11 additions & 4 deletions src/gadgets/byte_representation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,18 @@ impl ByteRepresentationConfig {
.collect();
for assignment in assignments.into_iter() {
match assignment.column {
Column::Selector(s) => region.assign_fixed(|| "fixed", s.0, assignment.offset, || assignment.value),
Column::Advice(s) => region.assign_advice(|| "advice", s.0, assignment.offset, || assignment.value),
Column::SecondPhaseAdvice(s) => {
region.assign_advice(|| "second phase advice", s.0, assignment.offset, || assignment.value)
Column::Selector(s) => {
region.assign_fixed(|| "fixed", s.0, assignment.offset, || assignment.value)
}
Column::Advice(s) => {
region.assign_advice(|| "advice", s.0, assignment.offset, || assignment.value)
}
Column::SecondPhaseAdvice(s) => region.assign_advice(
|| "second phase advice",
s.0,
assignment.offset,
|| assignment.value,
),
_ => unreachable!(),
}
.unwrap();
Expand Down
8 changes: 2 additions & 6 deletions src/gadgets/is_zero.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use crate::assignment_map::{Assignment, Column};
use crate::assignment_map::Assignment;
use crate::constraint_builder::{AdviceColumn, BinaryQuery, ConstraintBuilder, Query};
use halo2_proofs::{
arithmetic::FieldExt,
circuit::{Region, Value},
plonk::ConstraintSystem,
};
use halo2_proofs::{arithmetic::FieldExt, circuit::Region, plonk::ConstraintSystem};
use std::fmt::Debug;

#[derive(Clone, Copy)]
Expand Down
5 changes: 1 addition & 4 deletions src/gadgets/key_bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ use crate::{
constraint_builder::{AdviceColumn, ConstraintBuilder, Query, SelectorColumn},
};
use halo2_proofs::{
arithmetic::FieldExt,
circuit::{Region, Value},
halo2curves::bn256::Fr,
plonk::ConstraintSystem,
arithmetic::FieldExt, circuit::Region, halo2curves::bn256::Fr, plonk::ConstraintSystem,
};
use rayon::prelude::*;

Expand Down
4 changes: 2 additions & 2 deletions src/mpt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
assignment_map::{AssignmentMap, Column, Assignment},
assignment_map::{Assignment, AssignmentMap},
constraint_builder::{ConstraintBuilder, SelectorColumn},
gadgets::{
byte_bit::ByteBitGadget,
Expand All @@ -18,7 +18,7 @@ use crate::{
};
use halo2_proofs::{
arithmetic::FieldExt,
circuit::{Layouter, Value},
circuit::Layouter,
halo2curves::bn256::Fr,
plonk::{Challenge, ConstraintSystem, Error, Expression, VirtualCells},
};
Expand Down

0 comments on commit bbda728

Please sign in to comment.