Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
Draft
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
13 changes: 12 additions & 1 deletion eth-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,18 @@ impl Serialize for GethExecError {
S: serde::Serializer,
{
// We serialize the error as a string constant.
serializer.serialize_str(self.error())
let e = match self {
GethExecError::StackUnderflow {
stack_len,
required,
} => format!("stack underflow ({stack_len} <=> {required})"),
GethExecError::StackOverflow { stack_len, limit } => {
format!("stack limit reached {stack_len} ({limit})")
}
GethExecError::InvalidOpcode(op) => format!("invalid opcode: {op}"),
_ => self.error().to_string(),
};
serializer.serialize_str(&e)
}
}

Expand Down
Loading