Skip to content

Commit

Permalink
Merge pull request #262 from davidrusu/misc-fixes
Browse files Browse the repository at this point in the history
typo: Err::InconsistentOwneResourceId -> InconsistentOwnedResourceId
  • Loading branch information
XuyangSong authored Mar 25, 2024
2 parents 16eeeab + d2454f4 commit 7b60eae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion taiga_halo2/src/circuit/vp_bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl ApplicationByteCode {
let id = dynamic_vp.verify_transparently(compliance_nfs, compliance_cms)?;
// check: the app_vp and dynamic_vps belong to the resource
if id != owned_resource_id {
return Err(TransactionError::InconsistentOwneResourceID);
return Err(TransactionError::InconsistentOwnedResourceID);
}
}
Ok(owned_resource_id)
Expand Down
4 changes: 2 additions & 2 deletions taiga_halo2/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub enum TransactionError {
/// Output resource commitment is not consistent between the compliance and the vp.
InconsistentOutputResourceCommitment,
/// Owned resource id is not consistent between the compliance and the vp.
InconsistentOwneResourceID,
InconsistentOwnedResourceID,
/// IO error
IoError(std::io::Error),
/// Transparent resource nullifier key is missing
Expand All @@ -41,7 +41,7 @@ impl Display for TransactionError {
InconsistentOutputResourceCommitment => f.write_str(
"Output resource commitment is not consistent between the compliance and the vp",
),
InconsistentOwneResourceID => {
InconsistentOwnedResourceID => {
f.write_str("Owned resource id is not consistent between the compliance and the vp")
}
IoError(e) => f.write_str(&format!("IoError error: {e}")),
Expand Down
8 changes: 4 additions & 4 deletions taiga_halo2/src/shielded_ptx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ impl ShieldedPartialTransaction {
let owned_resource_id = vp_info.app_vp_verifying_info.get_owned_resource_id();
for logic_vp_verifying_info in vp_info.app_dynamic_vp_verifying_info.iter() {
if owned_resource_id != logic_vp_verifying_info.get_owned_resource_id() {
return Err(TransactionError::InconsistentOwneResourceID);
return Err(TransactionError::InconsistentOwnedResourceID);
}
}

// Check the owned_resource_id that vp uses is consistent with the nf from the compliance circuit
if owned_resource_id != compliance_nf.inner() {
return Err(TransactionError::InconsistentOwneResourceID);
return Err(TransactionError::InconsistentOwnedResourceID);
}
}
Ok(())
Expand All @@ -214,13 +214,13 @@ impl ShieldedPartialTransaction {
let owned_resource_id = vp_info.app_vp_verifying_info.get_owned_resource_id();
for logic_vp_verifying_info in vp_info.app_dynamic_vp_verifying_info.iter() {
if owned_resource_id != logic_vp_verifying_info.get_owned_resource_id() {
return Err(TransactionError::InconsistentOwneResourceID);
return Err(TransactionError::InconsistentOwnedResourceID);
}
}

// Check the owned_resource_id that vp uses is consistent with the cm from the compliance circuit
if owned_resource_id != compliance_cm.inner() {
return Err(TransactionError::InconsistentOwneResourceID);
return Err(TransactionError::InconsistentOwnedResourceID);
}
}
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions taiga_halo2/src/transparent_ptx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ impl Executable for TransparentPartialTransaction {
let owned_resource_id = vp.verify_transparently(&compliance_nfs, &compliance_cms)?;
// Check all resources are checked
if owned_resource_id != nf.inner() {
return Err(TransactionError::InconsistentOwneResourceID);
return Err(TransactionError::InconsistentOwnedResourceID);
}
}

for (vp, cm) in self.output_resource_app.iter().zip(compliance_cms.iter()) {
let owned_resource_id = vp.verify_transparently(&compliance_nfs, &compliance_cms)?;
// Check all resources are checked
if owned_resource_id != cm.inner() {
return Err(TransactionError::InconsistentOwneResourceID);
return Err(TransactionError::InconsistentOwnedResourceID);
}
}

Expand Down

0 comments on commit 7b60eae

Please sign in to comment.