mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 11:17:56 +00:00
use thiserror instead of derive_more for error handling (#10696)
* use thiserror instead of derive_more for error handling Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Update utils/prometheus/src/lib.rs * Update utils/prometheus/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -40,8 +40,9 @@ use substrate_test_runtime_client::{
|
||||
};
|
||||
|
||||
/// Error type used by [`TestApi`].
|
||||
#[derive(Debug, derive_more::From, derive_more::Display)]
|
||||
pub struct Error(sc_transaction_pool_api::error::Error);
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[error(transparent)]
|
||||
pub struct Error(#[from] sc_transaction_pool_api::error::Error);
|
||||
|
||||
impl sc_transaction_pool_api::error::IntoPoolError for Error {
|
||||
fn into_pool_error(self) -> Result<sc_transaction_pool_api::error::Error, Self> {
|
||||
@@ -49,12 +50,6 @@ impl sc_transaction_pool_api::error::IntoPoolError for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for Error {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
Some(&self.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub enum IsBestBlock {
|
||||
Yes,
|
||||
No,
|
||||
|
||||
Reference in New Issue
Block a user