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

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Aug 12, 2024
1 parent bdacaa5 commit 6f6c629
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
14 changes: 9 additions & 5 deletions src/tests/complex_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,12 @@ pub(crate) fn generate_base_layer(
.map(|x| ZkSyncBaseLayerStorage::from_inner(a as u8, x))
.collect(),
)),
WitnessGenerationArtifact::UnsortedMemoryQueueWitness(witnesses) => unsorted_memory_queue_witnesses.push(witnesses),
WitnessGenerationArtifact::SortedMemoryQueueWitness(witnesses) => sorted_memory_queue_witnesses.push(witnesses),
WitnessGenerationArtifact::UnsortedMemoryQueueWitness(witnesses) => {
unsorted_memory_queue_witnesses.push(witnesses)
}
WitnessGenerationArtifact::SortedMemoryQueueWitness(witnesses) => {
sorted_memory_queue_witnesses.push(witnesses)
}
};

let (scheduler_partial_input, _aux_data) = run(
Expand Down Expand Up @@ -299,14 +303,14 @@ pub(crate) fn generate_base_layer(
ZkSyncBaseLayerCircuit::RAMPermutation(inner) => {
let mut witness = inner.witness.take().unwrap();
witness.sorted_queue_witness = FullStateCircuitQueueRawWitness {
elements: sorted_memory_queue_witnesses.next().unwrap().into()
elements: sorted_memory_queue_witnesses.next().unwrap().into(),
};
witness.unsorted_queue_witness = FullStateCircuitQueueRawWitness {
elements: unsorted_memory_queue_witnesses_it.next().unwrap().into()
elements: unsorted_memory_queue_witnesses_it.next().unwrap().into(),
};

inner.witness.store(Some(witness));
},
}
_ => {}
}
}
Expand Down
14 changes: 9 additions & 5 deletions src/tests/run_manually.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,12 @@ pub(crate) fn run_with_options(entry_point_bytecode: Vec<[u8; 32]>, options: Opt

let artifacts_callback = |artifact: WitnessGenerationArtifact| match artifact {
WitnessGenerationArtifact::BaseLayerCircuit(circuit) => basic_block_circuits.push(circuit),
WitnessGenerationArtifact::UnsortedMemoryQueueWitness(witnesses) => unsorted_memory_queue_witnesses.push(witnesses),
WitnessGenerationArtifact::SortedMemoryQueueWitness(witnesses) => sorted_memory_queue_witnesses.push(witnesses),
WitnessGenerationArtifact::UnsortedMemoryQueueWitness(witnesses) => {
unsorted_memory_queue_witnesses.push(witnesses)
}
WitnessGenerationArtifact::SortedMemoryQueueWitness(witnesses) => {
sorted_memory_queue_witnesses.push(witnesses)
}
_ => {}
};

Expand Down Expand Up @@ -321,14 +325,14 @@ pub(crate) fn run_with_options(entry_point_bytecode: Vec<[u8; 32]>, options: Opt
ZkSyncBaseLayerCircuit::RAMPermutation(inner) => {
let mut witness = inner.witness.take().unwrap();
witness.sorted_queue_witness = FullStateCircuitQueueRawWitness {
elements: sorted_memory_queue_witnesses.next().unwrap().into()
elements: sorted_memory_queue_witnesses.next().unwrap().into(),
};
witness.unsorted_queue_witness = FullStateCircuitQueueRawWitness {
elements: unsorted_memory_queue_witnesses_it.next().unwrap().into()
elements: unsorted_memory_queue_witnesses_it.next().unwrap().into(),
};

inner.witness.store(Some(witness));
},
}
_ => {}
}
base_test_circuit(el);
Expand Down
12 changes: 6 additions & 6 deletions src/witness/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,10 @@ fn simulate_memory_queue(
round_function: Poseidon2Goldilocks,
channel_sender: Sender<WitnessGenerationArtifact>,
) -> (
CircuitsEntryAccumulatorSparse<(u32, QueueStateWitness<GoldilocksField, FULL_SPONGE_QUEUE_STATE_WIDTH>)>,
CircuitsEntryAccumulatorSparse<(
u32,
QueueStateWitness<GoldilocksField, FULL_SPONGE_QUEUE_STATE_WIDTH>,
)>,
MemoryQueueState<GoldilocksField>,
LastPerCircuitAccumulator<MemoryQueueState<GoldilocksField>>,
MemoryQueuePerCircuitSimulator<GoldilocksField>,
Expand Down Expand Up @@ -894,10 +897,7 @@ fn simulate_memory_queue(
}
}

assert_eq!(
memory_queries.len(),
memory_queue_states_accumulator.len()
);
assert_eq!(memory_queries.len(), memory_queue_states_accumulator.len());
assert_eq!(
memory_queries.len(),
memory_queue_simulator.num_items as usize
Expand Down Expand Up @@ -1220,7 +1220,7 @@ fn process_memory_related_circuits<CB: FnMut(WitnessGenerationArtifact)>(

let memory_artifacts_for_main_vm = MemoryArtifacts {
memory_queries: Arc::into_inner(memory_queries_arc).unwrap(),
memory_queue_entry_states: memory_queue_entry_states_for_main_vm
memory_queue_entry_states: memory_queue_entry_states_for_main_vm,
};
let implicit_memory_queries = Arc::into_inner(implicit_memory_queries_arc).unwrap();

Expand Down

0 comments on commit 6f6c629

Please sign in to comment.