Skip to content

Commit

Permalink
refactor: remove unused, untested add_to_verification_obligation_and_…
Browse files Browse the repository at this point in the history
…verify

We already have `add_to_verification_obligation_and_verify`, so this should lower confusion
  • Loading branch information
huitseeker committed Nov 29, 2022
1 parent 4b0f68e commit e5f3239
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions crates/sui-types/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,13 +916,6 @@ pub trait SuiSignature: Sized + signature::Signature {
fn verify_secure<T>(&self, value: &T, intent: Intent, author: SuiAddress) -> SuiResult<()>
where
T: Serialize;

fn add_to_verification_obligation_or_verify(
&self,
author: SuiAddress,
obligation: &mut VerificationObligation,
idx: usize,
) -> SuiResult<()>;
}

impl<S: SuiSignatureInner + Sized> SuiSignature for S {
Expand Down Expand Up @@ -974,24 +967,6 @@ impl<S: SuiSignatureInner + Sized> SuiSignature for S {
})
}

fn add_to_verification_obligation_or_verify(
&self,
author: SuiAddress,
obligation: &mut VerificationObligation,
idx: usize,
) -> SuiResult<()> {
let (sig, pk) = self.get_verification_inputs(author)?;
match obligation.add_signature_and_public_key(sig.clone(), pk.clone(), idx) {
Ok(_) => Ok(()),
Err(err) => {
let msg = &obligation.messages[idx][..];
pk.verify(msg, &sig)
.map_err(|_| SuiError::InvalidSignature {
error: err.to_string(),
})
}
}
}
}

/// AuthoritySignInfoTrait is a trait used specifically for a few structs in messages.rs
Expand Down

0 comments on commit e5f3239

Please sign in to comment.