Remove empty blob handling as it's handled in kzg library
This commit is contained in:
parent
e548073602
commit
0ed3f7474c
@ -19,8 +19,6 @@ pub enum Error {
|
|||||||
InvalidKzgCommitment(CKzgError),
|
InvalidKzgCommitment(CKzgError),
|
||||||
InvalidKzgProof(CKzgError),
|
InvalidKzgProof(CKzgError),
|
||||||
KzgVerificationFailed(CKzgError),
|
KzgVerificationFailed(CKzgError),
|
||||||
EmptyBlobs,
|
|
||||||
EmptyKzgCommitments,
|
|
||||||
InvalidLength(String),
|
InvalidLength(String),
|
||||||
KzgProofComputationFailed(CKzgError),
|
KzgProofComputationFailed(CKzgError),
|
||||||
}
|
}
|
||||||
@ -39,9 +37,6 @@ impl Kzg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn compute_aggregate_kzg_proof(&self, blobs: &[Blob]) -> Result<KzgProof, Error> {
|
pub fn compute_aggregate_kzg_proof(&self, blobs: &[Blob]) -> Result<KzgProof, Error> {
|
||||||
if blobs.len() == 0 {
|
|
||||||
return Err(Error::EmptyBlobs);
|
|
||||||
}
|
|
||||||
c_kzg::KZGProof::compute_aggregate_kzg_proof(blobs, &self.trusted_setup)
|
c_kzg::KZGProof::compute_aggregate_kzg_proof(blobs, &self.trusted_setup)
|
||||||
.map_err(Error::KzgProofComputationFailed)
|
.map_err(Error::KzgProofComputationFailed)
|
||||||
.map(|proof| KzgProof(proof.to_bytes()))
|
.map(|proof| KzgProof(proof.to_bytes()))
|
||||||
@ -53,12 +48,6 @@ impl Kzg {
|
|||||||
expected_kzg_commitments: &[KzgCommitment],
|
expected_kzg_commitments: &[KzgCommitment],
|
||||||
kzg_aggregated_proof: KzgProof,
|
kzg_aggregated_proof: KzgProof,
|
||||||
) -> Result<bool, Error> {
|
) -> Result<bool, Error> {
|
||||||
if blobs.len() == 0 {
|
|
||||||
return Err(Error::EmptyBlobs);
|
|
||||||
}
|
|
||||||
if expected_kzg_commitments.len() == 0 {
|
|
||||||
return Err(Error::EmptyBlobs);
|
|
||||||
}
|
|
||||||
if blobs.len() != expected_kzg_commitments.len() {
|
if blobs.len() != expected_kzg_commitments.len() {
|
||||||
return Err(Error::InvalidLength(
|
return Err(Error::InvalidLength(
|
||||||
"blobs and expected_kzg_commitments should be of same size".to_string(),
|
"blobs and expected_kzg_commitments should be of same size".to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user