Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
CeciliaZ030 committed Jun 9, 2024
1 parent 04e35c3 commit 2811968
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ impl Prover for NativeProver {
let pi = ProtocolInstance::new(&input, &output.header, VerifierType::None)
.map_err(|e| ProverError::GuestError(e.to_string()))?;
if pi.instance_hash() != output.hash {
return Err(ProverError::GuestError("Protocol Instance hash not matched".to_string()));
return Err(ProverError::GuestError(
"Protocol Instance hash not matched".to_string(),
));
}

to_proof(Ok(NativeResponse {
Expand Down
9 changes: 7 additions & 2 deletions lib/src/protocol_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@ impl ProtocolInstance {
let mut data = Vec::from(KZG_TRUST_SETUP_DATA);
let kzg_settings = KzgSettings::from_u8_slice(&mut data);
let kzg_commit = KzgCommitment::blob_to_kzg_commitment(
&Blob::from_bytes(input.taiko.tx_data.as_slice()).expect("Fail to form blob from tx bytes"),
&Blob::from_bytes(input.taiko.tx_data.as_slice())
.expect("Fail to form blob from tx bytes"),
&kzg_settings,
)
.expect("Fail to calculate KZG commitment");
let versioned_hash = kzg_to_versioned_hash(&kzg_commit);
assert_eq!(versioned_hash, input.taiko.tx_blob_hash.unwrap(), "Blob version hash not matching");
assert_eq!(
versioned_hash,
input.taiko.tx_blob_hash.unwrap(),
"Blob version hash not matching"
);
versioned_hash
}
} else {
Expand Down

0 comments on commit 2811968

Please sign in to comment.