|
@@ -1,5 +1,3 @@
|
|
|
-use crate::node::{client, state};
|
|
|
|
|
-
|
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, thiserror::Error)]
|
|
#[derive(Debug, Clone, thiserror::Error)]
|
|
@@ -79,8 +77,10 @@ pub enum Error {
|
|
|
PlonkError(String),
|
|
PlonkError(String),
|
|
|
#[error("Unable to decrypt mint note")]
|
|
#[error("Unable to decrypt mint note")]
|
|
|
NoteDecryptionFailed,
|
|
NoteDecryptionFailed,
|
|
|
|
|
+
|
|
|
|
|
+ #[cfg(feature = "node")]
|
|
|
#[error(transparent)]
|
|
#[error(transparent)]
|
|
|
- VerifyFailed(#[from] state::VerifyFailed),
|
|
|
|
|
|
|
+ VerifyFailed(#[from] crate::node::state::VerifyFailed),
|
|
|
#[error("MerkleTree is full")]
|
|
#[error("MerkleTree is full")]
|
|
|
TreeFull,
|
|
TreeFull,
|
|
|
|
|
|
|
@@ -164,18 +164,21 @@ pub enum Error {
|
|
|
InvalidAddress,
|
|
InvalidAddress,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#[cfg(feature = "node")]
|
|
|
impl From<zeromq::ZmqError> for Error {
|
|
impl From<zeromq::ZmqError> for Error {
|
|
|
fn from(err: zeromq::ZmqError) -> Error {
|
|
fn from(err: zeromq::ZmqError) -> Error {
|
|
|
Error::ZmqError(err.to_string())
|
|
Error::ZmqError(err.to_string())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#[cfg(feature = "blockchain")]
|
|
|
impl From<rocksdb::Error> for Error {
|
|
impl From<rocksdb::Error> for Error {
|
|
|
fn from(err: rocksdb::Error) -> Error {
|
|
fn from(err: rocksdb::Error) -> Error {
|
|
|
Error::RocksdbError(err.to_string())
|
|
Error::RocksdbError(err.to_string())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#[cfg(feature = "node")]
|
|
|
impl From<sqlx::error::Error> for Error {
|
|
impl From<sqlx::error::Error> for Error {
|
|
|
fn from(err: sqlx::error::Error) -> Error {
|
|
fn from(err: sqlx::error::Error) -> Error {
|
|
|
Error::SqlxError(err.to_string())
|
|
Error::SqlxError(err.to_string())
|
|
@@ -212,8 +215,9 @@ impl From<url::ParseError> for Error {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-impl From<client::ClientFailed> for Error {
|
|
|
|
|
- fn from(err: client::ClientFailed) -> Error {
|
|
|
|
|
|
|
+#[cfg(feature = "node")]
|
|
|
|
|
+impl From<crate::node::client::ClientFailed> for Error {
|
|
|
|
|
+ fn from(err: crate::node::client::ClientFailed) -> Error {
|
|
|
Error::ClientFailed(err.to_string())
|
|
Error::ClientFailed(err.to_string())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -243,13 +247,6 @@ impl From<halo2::plonk::Error> for Error {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#[cfg(feature = "darkpulse")]
|
|
|
|
|
-impl From<rusqlite::Error> for Error {
|
|
|
|
|
- fn from(err: rusqlite::Error) -> Error {
|
|
|
|
|
- Error::SqlxError(err.to_string())
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
impl From<Box<bincode::ErrorKind>> for Error {
|
|
impl From<Box<bincode::ErrorKind>> for Error {
|
|
|
fn from(err: Box<bincode::ErrorKind>) -> Error {
|
|
fn from(err: Box<bincode::ErrorKind>) -> Error {
|
|
|
Error::BincodeError(err.to_string())
|
|
Error::BincodeError(err.to_string())
|