diff --git a/zebra-network/src/protocol/internal.rs b/zebra-network/src/protocol/internal.rs index d7d804f97..cd40d9757 100644 --- a/zebra-network/src/protocol/internal.rs +++ b/zebra-network/src/protocol/internal.rs @@ -4,6 +4,8 @@ //! responses, so that we have unified types to pass around. No serialization //! is performed as these are only internal types. +use std::error::Error; + use zebra_chain::transaction::Transaction; use crate::meta_addr::MetaAddr; @@ -32,8 +34,19 @@ pub enum Request { pub enum Response { /// Generic success. Ok, + /// Generic error. + Error, /// A list of peers, used to respond to `GetPeers`. Peers(Vec), /// A list of transactions, such as in response to `GetMempool`. Transactions(Vec), } + +impl From for Response +where + E: Error, +{ + fn from(e: E) -> Self { + Self::Error + } +}