Skip to content

Commit cea7b8e

Browse files
committed
Clean some calls
1 parent 9c7acbf commit cea7b8e

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

operator/mina/lib/src/pickles_preproc/preprocess.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use kimchi::{circuits::wires::COLUMNS, mina_curves::pasta::Pallas, poly_commitment::PolyComm};
22

3-
use crate::pickles_preproc::type_aliases::{WrapECPoint, WrapProverCommitments};
3+
use crate::pickles_preproc::{
4+
state_proof::Commitments,
5+
type_aliases::{WrapECPoint, WrapProverCommitments},
6+
};
47

58
use super::{
69
state_proof::StateProof,
@@ -10,30 +13,27 @@ use super::{
1013
pub fn deserialize_state_proof(
1114
state_proof: StateProof,
1215
) -> Result<(WrapVerifierIndex, WrapProverProof), String> {
16+
let Commitments {
17+
w_comm: hex_w_comm,
18+
z_comm: hex_z_comm,
19+
t_comm: hex_t_comm,
20+
} = state_proof.proof.commitments;
21+
1322
// w_comm are single-point commitments
1423
let mut w_comm: [PolyComm<Pallas>; COLUMNS] = std::array::from_fn(|_| PolyComm {
1524
elems: Vec::with_capacity(1),
1625
});
17-
for (hex_comm, comm) in state_proof
18-
.proof
19-
.commitments
20-
.w_comm
21-
.into_iter()
22-
.zip(w_comm.iter_mut())
23-
{
24-
comm.elems.push(WrapECPoint::try_from(hex_comm)?.0);
26+
for (hex_point, comm) in hex_w_comm.into_iter().zip(w_comm.iter_mut()) {
27+
comm.elems.push(WrapECPoint::try_from(hex_point)?.0);
2528
}
2629

2730
// z_comm is a single-point commitment
2831
let z_comm = PolyComm {
29-
elems: vec![WrapECPoint::try_from(state_proof.proof.commitments.z_comm)?.0],
32+
elems: vec![WrapECPoint::try_from(hex_z_comm)?.0],
3033
};
3134
// t_comm is a multi-point commitment
3235
let t_comm = PolyComm {
33-
elems: state_proof
34-
.proof
35-
.commitments
36-
.t_comm
36+
elems: hex_t_comm
3737
.into_iter()
3838
.map(|hex_point| WrapECPoint::try_from(hex_point).map(|point| point.0))
3939
.collect::<Result<_, _>>()?,

0 commit comments

Comments
 (0)