From 1cbb27d5e1962c6fffd72100e69f76b3d2e50875 Mon Sep 17 00:00:00 2001 From: SantiagoPittella Date: Wed, 25 Sep 2024 11:33:56 -0300 Subject: [PATCH] feat: remove DeserializationError from TransactionProverErrors --- bin/tx-prover/src/server/mod.rs | 6 +++--- miden-tx/src/errors/mod.rs | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/bin/tx-prover/src/server/mod.rs b/bin/tx-prover/src/server/mod.rs index 01919b954..daeb224f9 100644 --- a/bin/tx-prover/src/server/mod.rs +++ b/bin/tx-prover/src/server/mod.rs @@ -1,8 +1,9 @@ use generated::api::{api_server, ProveTransactionRequest, ProveTransactionResponse}; use miden_objects::transaction::{ProvenTransaction, TransactionWitness}; +use miden_prover::DeserializationError; use miden_tx::{ utils::{Deserializable, Serializable}, - LocalTransactionProver, TransactionProver, TransactionProverError, + LocalTransactionProver, TransactionProver, }; use tokio::{net::TcpListener, sync::Mutex}; use tonic::{Request, Response, Status}; @@ -66,11 +67,10 @@ impl From for ProveTransactionResponse { } impl TryFrom for ProvenTransaction { - type Error = TransactionProverError; + type Error = DeserializationError; fn try_from(response: ProveTransactionResponse) -> Result { ProvenTransaction::read_from_bytes(&response.proven_transaction) - .map_err(|err| TransactionProverError::DeserializationError(err.to_string())) } } diff --git a/miden-tx/src/errors/mod.rs b/miden-tx/src/errors/mod.rs index 73b0a97f9..145e5756b 100644 --- a/miden-tx/src/errors/mod.rs +++ b/miden-tx/src/errors/mod.rs @@ -48,7 +48,6 @@ pub enum TransactionProverError { InvalidTransactionOutput(TransactionOutputError), ProvenTransactionError(ProvenTransactionError), TransactionHostCreationFailed(TransactionHostError), - DeserializationError(String), } impl Display for TransactionProverError { @@ -69,9 +68,6 @@ impl Display for TransactionProverError { TransactionProverError::TransactionHostCreationFailed(inner) => { write!(f, "Failed to create the transaction host: {}", inner) }, - TransactionProverError::DeserializationError(inner) => { - write!(f, "Deserialization error: {}", inner) - }, } } }