Skip to content

Commit

Permalink
feat(forge): allow 0x prefixed bytes inputs (gakonst#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev authored Jan 6, 2022
1 parent 4f67610 commit 9686a8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ pub fn parse_tokens<'a, I: IntoIterator<Item = (&'a ParamType, &'a str)>>(
.into_iter()
.map(|(param, value)| {
let value = match param {
// allow addresses to be passed with "0x"
// allow addresses and bytes to be passed with "0x"
ParamType::Address => value.strip_prefix("0x").unwrap_or(value),
ParamType::Bytes => value.strip_prefix("0x").unwrap_or(value),
ParamType::FixedBytes(_size) => value.strip_prefix("0x").unwrap_or(value),
_ => value,
};
if lenient {
Expand Down

0 comments on commit 9686a8b

Please sign in to comment.