diff --git a/zebra-consensus/src/error.rs b/zebra-consensus/src/error.rs index caa2f2edb..419dc2e8d 100644 --- a/zebra-consensus/src/error.rs +++ b/zebra-consensus/src/error.rs @@ -67,13 +67,20 @@ pub enum TransactionError { #[error("bindingSig MUST represent a valid signature under the transaction binding validating key bvk of SigHash")] RedJubjub(redjubjub::Error), + + // temporary error type until #1186 is fixed + #[error("Downcast from BoxError to redjubjub::Error failed")] + InternalDowncastError(String), } impl From for TransactionError { fn from(err: BoxError) -> Self { match err.downcast::() { Ok(e) => TransactionError::RedJubjub(*e), - Err(e) => panic!(e), + Err(e) => TransactionError::InternalDowncastError(format!( + "downcast to redjubjub::Error failed, original error: {:?}", + e + )), } } }