mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
refactor secp errors in transaction (#1955)
* cleanup secp errors in transaction * rustfmt
This commit is contained in:
parent
9af9ca9518
commit
29b2c3384c
1 changed files with 8 additions and 12 deletions
|
@ -1088,26 +1088,22 @@ impl Output {
|
|||
}
|
||||
|
||||
/// Validates the range proof using the commitment
|
||||
pub fn verify_proof(&self) -> Result<(), secp::Error> {
|
||||
pub fn verify_proof(&self) -> Result<(), Error> {
|
||||
let secp = static_secp_instance();
|
||||
let secp = secp.lock();
|
||||
match secp.verify_bullet_proof(self.commit, self.proof, None) {
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
secp.lock()
|
||||
.verify_bullet_proof(self.commit, self.proof, None)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Batch validates the range proofs using the commitments
|
||||
pub fn batch_verify_proofs(
|
||||
commits: &Vec<Commitment>,
|
||||
proofs: &Vec<RangeProof>,
|
||||
) -> Result<(), secp::Error> {
|
||||
) -> Result<(), Error> {
|
||||
let secp = static_secp_instance();
|
||||
let secp = secp.lock();
|
||||
match secp.verify_bullet_proof_multi(commits.clone(), proofs.clone(), None) {
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
secp.lock()
|
||||
.verify_bullet_proof_multi(commits.clone(), proofs.clone(), None)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue