Skip to content
Open
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
6 changes: 5 additions & 1 deletion ethabi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ edition = "2021"
[dependencies]
hex = { version = "0.4", default-features = false, features = ["alloc"] }
serde = { version = "1.0", optional = true, default-features = false, features = ["derive"] }
serde_json = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
sha3 = { version = "0.10", default-features = false }
ethereum-types = { version = "0.14.0", default-features = false }
thiserror = { version = "1", optional = true }
uint = { version = "0.9.0", default-features = false, optional = true }
regex = { version = "1.5.4", optional = true }
once_cell = { version = "1.9.0", optional = true }

[target.'cfg(not(feature = "std"))'.dependencies]
displaydoc = { version = "0.2", default-features = false }

[dev-dependencies]
hex-literal = "0.3"
paste = "1"
Expand All @@ -41,6 +44,7 @@ std = [
"thiserror",
"uint?/std",
"serde?/std",
"serde_json?/std",
]

serde = [
Expand Down
3 changes: 3 additions & 0 deletions ethabi/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ use crate::no_std_prelude::*;
use core::num;
#[cfg(feature = "std")]
use thiserror::Error;
#[cfg(not(feature = "std"))]
use displaydoc::Display;

/// Ethabi result type
pub type Result<T> = core::result::Result<T, Error>;

/// Ethabi errors
#[cfg_attr(feature = "std", derive(Error))]
#[cfg_attr(not(feature = "std"), derive(Display))]
#[derive(Debug)]
pub enum Error {
/// Invalid entity such as a bad function name.
Expand Down