forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3dc6c6
commit 0eea639
Showing
13 changed files
with
564 additions
and
104 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,38 @@ | ||
use derive_more::Display; | ||
use pairing_api::PairingClientError; | ||
use relay_client::error::{ClientError, Error}; | ||
use relay_rpc::rpc::PublishError; | ||
use relay_rpc::rpc::{PublishError, SubscriptionError}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Display, Serialize, Deserialize)] | ||
pub enum WalletConnectClientError { | ||
pub enum WalletConnectCtxError { | ||
PairingError(String), | ||
EncodeError(String), | ||
PublishError(String), | ||
ClientError(String), | ||
PairingNotFound(String), | ||
SubscriptionError(String), | ||
InternalError(String), | ||
SerdeError(String), | ||
UnsuccessfulResponse(String) | ||
} | ||
|
||
impl From<PairingClientError> for WalletConnectClientError { | ||
fn from(error: PairingClientError) -> Self { WalletConnectClientError::PairingError(error.to_string()) } | ||
impl From<PairingClientError> for WalletConnectCtxError { | ||
fn from(error: PairingClientError) -> Self { WalletConnectCtxError::PairingError(error.to_string()) } | ||
} | ||
|
||
impl From<ClientError> for WalletConnectClientError { | ||
fn from(error: ClientError) -> Self { WalletConnectClientError::ClientError(error.to_string()) } | ||
impl From<ClientError> for WalletConnectCtxError { | ||
fn from(error: ClientError) -> Self { WalletConnectCtxError::ClientError(error.to_string()) } | ||
} | ||
|
||
impl From<Error<PublishError>> for WalletConnectClientError { | ||
fn from(error: Error<PublishError>) -> Self { WalletConnectClientError::PublishError(format!("{error:?}")) } | ||
impl From<Error<PublishError>> for WalletConnectCtxError { | ||
fn from(error: Error<PublishError>) -> Self { WalletConnectCtxError::PublishError(format!("{error:?}")) } | ||
} | ||
|
||
impl From<Error<SubscriptionError>> for WalletConnectCtxError { | ||
fn from(error: Error<SubscriptionError>) -> Self { WalletConnectCtxError::SubscriptionError(format!("{error:?}")) } | ||
} | ||
|
||
impl From<serde_json::Error> for WalletConnectCtxError { | ||
fn from(value: serde_json::Error) -> Self { WalletConnectCtxError::SerdeError(value.to_string()) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.