Skip to content

Commit 5e43630

Browse files
committed
chore: address clippy warnings
1 parent 454f80c commit 5e43630

File tree

6 files changed

+13
-20
lines changed

6 files changed

+13
-20
lines changed

aggregation_mode/src/aggregators/lib.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::{
2-
risc0_aggregator::{self, Risc0AggregationInput, Risc0ProofReceiptAndImageId},
3-
sp1_aggregator::{self, SP1AggregationInput, SP1ProofWithPubValuesAndElf},
2+
risc0_aggregator::{Risc0AggregationInput, Risc0ProofReceiptAndImageId},
3+
sp1_aggregator::{SP1AggregationInput, SP1ProofWithPubValuesAndElf},
44
};
55

66
pub enum ProgramInput {
@@ -9,8 +9,8 @@ pub enum ProgramInput {
99
}
1010

1111
pub enum AggregatedProof {
12-
SP1(SP1ProofWithPubValuesAndElf),
13-
Risc0(Risc0ProofReceiptAndImageId),
12+
SP1(Box<SP1ProofWithPubValuesAndElf>),
13+
Risc0(Box<Risc0ProofReceiptAndImageId>),
1414
}
1515

1616
pub struct ProgramOutput {
@@ -30,10 +30,3 @@ pub enum ProofAggregationError {
3030
Risc0Proving(String),
3131
UnsupportedProof,
3232
}
33-
34-
pub fn aggregate_proofs(input: ProgramInput) -> Result<ProgramOutput, ProofAggregationError> {
35-
match input {
36-
ProgramInput::SP1(input) => sp1_aggregator::aggregate_proofs(input),
37-
ProgramInput::Risc0(input) => risc0_aggregator::aggregate_proofs(input),
38-
}
39-
}

aggregation_mode/src/aggregators/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ impl ZKVMEngine {
3939
}
4040

4141
pub enum AlignedProof {
42-
SP1(SP1ProofWithPubValuesAndElf),
43-
Risc0(Risc0ProofReceiptAndImageId),
42+
SP1(Box<SP1ProofWithPubValuesAndElf>),
43+
Risc0(Box<Risc0ProofReceiptAndImageId>),
4444
}
4545

4646
impl AlignedProof {

aggregation_mode/src/aggregators/risc0_aggregator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Risc0ProofReceiptAndImageId {
3333
impl Risc0ProofReceiptAndImageId {
3434
pub fn hash_image_id_and_public_inputs(&self) -> [u8; 32] {
3535
let mut hasher = Keccak256::new();
36-
hasher.update(&self.image_id);
36+
hasher.update(self.image_id);
3737
hasher.update(self.public_inputs());
3838
hasher.finalize().into()
3939
}
@@ -88,7 +88,7 @@ pub(crate) fn aggregate_proofs(
8888
receipt,
8989
};
9090

91-
Ok(ProgramOutput::new(AggregatedProof::Risc0(output)))
91+
Ok(ProgramOutput::new(AggregatedProof::Risc0(output.into())))
9292
}
9393

9494
#[derive(Debug)]

aggregation_mode/src/aggregators/sp1_aggregator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub(crate) fn aggregate_proofs(
9292
elf: PROGRAM_ELF.to_vec(),
9393
};
9494

95-
let output = ProgramOutput::new(AggregatedProof::SP1(proof_and_elf));
95+
let output = ProgramOutput::new(AggregatedProof::SP1(proof_and_elf.into()));
9696

9797
Ok(output)
9898
}

aggregation_mode/src/backend/fetcher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl ProofsFetcher {
119119
elf,
120120
};
121121

122-
Some(AlignedProof::SP1(sp1_proof))
122+
Some(AlignedProof::SP1(sp1_proof.into()))
123123
}
124124

125125
_ => None,
@@ -138,7 +138,7 @@ impl ProofsFetcher {
138138
let receipt = Receipt::new(inner_receipt, public_inputs);
139139
let risc0_proof = Risc0ProofReceiptAndImageId { image_id, receipt };
140140

141-
Some(AlignedProof::Risc0(risc0_proof))
141+
Some(AlignedProof::Risc0(risc0_proof.into()))
142142
}
143143
_ => None,
144144
})

aggregation_mode/src/backend/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl ProofAggregator {
118118
let proofs = proofs
119119
.into_iter()
120120
.filter_map(|proof| match proof {
121-
AlignedProof::SP1(proof) => Some(proof),
121+
AlignedProof::SP1(proof) => Some(*proof),
122122
_ => None,
123123
})
124124
.collect();
@@ -135,7 +135,7 @@ impl ProofAggregator {
135135
let proofs = proofs
136136
.into_iter()
137137
.filter_map(|proof| match proof {
138-
AlignedProof::Risc0(proof) => Some(proof),
138+
AlignedProof::Risc0(proof) => Some(*proof),
139139
_ => None,
140140
})
141141
.collect();

0 commit comments

Comments
 (0)