Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use thiserror instead of derive_more for error handling #555

Merged
merged 2 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ members = [
"template/node",
"template/runtime",
]
resolver = "2"
4 changes: 2 additions & 2 deletions client/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/su
log = "0.4.8"
futures = { version = "0.3.17", features = ["compat"] }
sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate" }
derive_more = "0.99.2"
thiserror = "1.0"
prometheus-endpoint = { version = "0.9.0", package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate" }
async-trait = "0.1"
async-trait = "0.1"
8 changes: 4 additions & 4 deletions client/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ use sp_consensus::Error as ConsensusError;
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
use std::{collections::HashMap, marker::PhantomData, sync::Arc};

#[derive(derive_more::Display, Debug)]
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[display(fmt = "Multiple runtime Ethereum blocks, rejecting!")]
#[error("Multiple runtime Ethereum blocks, rejecting!")]
MultipleRuntimeLogs,
#[display(fmt = "Runtime Ethereum block not found, rejecting!")]
#[error("Runtime Ethereum block not found, rejecting!")]
NoRuntimeLog,
#[display(fmt = "Cannot access the runtime at genesis, rejecting!")]
#[error("Cannot access the runtime at genesis, rejecting!")]
RuntimeApiCallFailed,
}

Expand Down
1 change: 0 additions & 1 deletion frame/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
description = "Ethereum compatibility full block processing emulation pallet for Substrate."
license = "Apache-2.0"
resolver = "2"

[dependencies]
rustc-hex = { version = "2.1.0", default-features = false }
Expand Down