Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat: add struct parsing support for human readable ABI #226

Merged
merged 4 commits into from
Mar 15, 2021
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
25 changes: 25 additions & 0 deletions ethers-core/src/abi/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//! Boilerplate error definitions.
use thiserror::Error;

/// A type alias for std's Result with the Error as our error type.
pub type Result<T, E = ParseError> = std::result::Result<T, E>;

#[derive(Error, Debug)]
pub enum ParseError {
#[error("{0}")]
Message(String),
#[error(transparent)]
ParseError(#[from] super::Error),
}

macro_rules! _format_err {
($($tt:tt)*) => {
$crate::abi::ParseError::Message(format!($($tt)*))
};
}
pub(crate) use _format_err as format_err;

macro_rules! _bail {
($($tt:tt)*) => { return Err($crate::abi::error::format_err!($($tt)*)) };
}
pub(crate) use _bail as bail;
Loading