Skip to content
Merged
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
5 changes: 2 additions & 3 deletions src/errors/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,15 @@ pub fn try_extract_revert(error: &str) -> Option<(String, String, Option<String>
let start = idx + "data: \"".len();
let end = error[start..].find('"').map(|i| start + i)?;
&error[start..end]
} else if let Some(idx) = error.find("data: 0x") {
} else {
let idx = error.find("data: 0x")?;
// Some RPC providers omit the quotes
let start = idx + "data: ".len();
let end = error[start..]
.find(|c: char| !c.is_ascii_hexdigit() && c != 'x')
.map(|i| start + i)
.unwrap_or(error.len());
&error[start..end]
} else {
return None;
};

if data.len() < 10 {
Expand Down
Loading