Browse Source

Handle error if user tries to create invalid lox_proof in PR

Vecna 2 months ago
parent
commit
15ed2a04bc
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/positive_report.rs

+ 3 - 3
src/positive_report.rs

@@ -71,9 +71,9 @@ impl PositiveReport {
         lox_cred: &Lox,
         lox_pub: &IssuerPubKey,
         country: String,
-    ) -> Self {
-        let lox_proof = lox_pr::request(lox_cred, lox_pub).unwrap();
-        PositiveReport::new(bridge_id, bridge_token, lox_proof, country)
+    ) -> Result<Self, lox_library::proto::positive_report::requestproof::ProofError> {
+        let lox_proof = lox_pr::request(lox_cred, lox_pub)?;
+        Ok(PositiveReport::new(bridge_id, bridge_token, lox_proof, country))
     }
 
     /// Convert report to a serializable version