fix(human-readable-abi): allow functions without output args (#477)
This commit is contained in:
parent
5693b7019e
commit
a9157e1543
|
@ -251,10 +251,9 @@ impl AbiParser {
|
||||||
.ok_or_else(|| format_err!("Expected input args parentheses at `{}`", s))?;
|
.ok_or_else(|| format_err!("Expected input args parentheses at `{}`", s))?;
|
||||||
|
|
||||||
let (input_args_modifiers, output_args) = match input.rsplit_once('(') {
|
let (input_args_modifiers, output_args) = match input.rsplit_once('(') {
|
||||||
Some((first, second)) => Ok((first, Some(second))),
|
Some((first, second)) => (first, Some(second)),
|
||||||
None if shorthand => Err(format_err!("Expected output args parentheses at `{}`", s)),
|
None => (input, None),
|
||||||
None => Ok((input, None)),
|
};
|
||||||
}?;
|
|
||||||
|
|
||||||
let mut input_args_modifiers_iter = input_args_modifiers
|
let mut input_args_modifiers_iter = input_args_modifiers
|
||||||
.trim_end()
|
.trim_end()
|
||||||
|
@ -645,6 +644,8 @@ mod tests {
|
||||||
"foo(address[] memory, bytes memory)(bytes memory)",
|
"foo(address[] memory, bytes memory)(bytes memory)",
|
||||||
"bar(uint256[] memory x)()",
|
"bar(uint256[] memory x)()",
|
||||||
"bar()()",
|
"bar()()",
|
||||||
|
"bar(uint256)",
|
||||||
|
"bar()",
|
||||||
]
|
]
|
||||||
.iter()
|
.iter()
|
||||||
.for_each(|x| {
|
.for_each(|x| {
|
||||||
|
|
Loading…
Reference in New Issue