Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
convert panic to error on sim2h_worker signing fail
Browse files Browse the repository at this point in the history
  • Loading branch information
zippy committed Jul 24, 2020
1 parent 5cfbea2 commit 6d8a267
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crates/net/src/sim2h_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,19 @@ impl Sim2hWorker {
message, buffered_message.hash
);
let payload: String = message.clone().into();
let signature = self
let maybe_signature = self
.conductor_api
.execute(payload.clone(), CryptoMethod::Sign)
.unwrap_or_else(|e| {
panic!(
.execute(payload.clone(), CryptoMethod::Sign);
let signature = match maybe_signature {
Err(e) => {
error!(
"Couldn't sign wire message in sim2h worker: payload={}, error={:?}",
payload, e
)
});
);
return false;
}
Ok(sig) => sig,
};
let payload: Opaque = payload.into();
let signed_wire_message = SignedWireMessage::new(
payload.clone(),
Expand Down

0 comments on commit 6d8a267

Please sign in to comment.