error rework, for polkadot convenience (#7446)

Co-authored-by: Bernhard Schuster <bernhard@parity.io>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Bernhard Schuster
2020-10-28 15:04:56 +01:00
committed by GitHub
parent 1679919830
commit 9687759774
17 changed files with 152 additions and 128 deletions
+3 -1
View File
@@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
log = { version = "0.4.8", default-features = false }
log = { version = "0.4.11", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
byteorder = { version = "1.3.2", default-features = false }
primitive-types = { version = "0.7.0", default-features = false, features = ["codec"] }
@@ -39,6 +39,7 @@ sp-storage = { version = "2.0.0", default-features = false, path = "../storage"
parity-util-mem = { version = "0.7.0", default-features = false, features = ["primitive-types"] }
futures = { version = "0.3.1", optional = true }
dyn-clonable = { version = "0.9.0", optional = true }
thiserror = { version = "1.0.21", optional = true }
# full crypto
ed25519-dalek = { version = "1.0.0-pre.4", default-features = false, features = ["u64_backend", "alloc"], optional = true }
@@ -74,6 +75,7 @@ default = ["std"]
std = [
"full_crypto",
"log/std",
"thiserror",
"wasmi",
"lazy_static",
"parking_lot",
+5 -1
View File
@@ -335,15 +335,19 @@ pub struct LocalizedSignature {
/// An error type for SS58 decoding.
#[cfg(feature = "std")]
#[derive(Clone, Copy, Eq, PartialEq, Debug)]
#[derive(Clone, Copy, Eq, PartialEq, Debug, thiserror::Error)]
pub enum PublicError {
/// Bad alphabet.
#[error("Base 58 requirement is violated")]
BadBase58,
/// Bad length.
#[error("Length is bad")]
BadLength,
/// Unknown version.
#[error("Unknown version")]
UnknownVersion,
/// Invalid checksum.
#[error("Invalid checksum")]
InvalidChecksum,
}
+1 -1
View File
@@ -28,7 +28,7 @@ pub use sp_externalities::{Externalities, ExternalitiesExt};
/// Code execution engine.
pub trait CodeExecutor: Sized + Send + Sync + CallInWasm + Clone + 'static {
/// Externalities error type.
type Error: Display + Debug + Send + 'static;
type Error: Display + Debug + Send + Sync + 'static;
/// Call a given method in the runtime. Returns a tuple of the result (either the output data
/// or an execution error) together with a `bool`, which is true if native execution was used.