Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instead of returning a String, return a ParamType #321

Open
github-actions bot opened this issue Jan 30, 2024 · 0 comments
Open

instead of returning a String, return a ParamType #321

github-actions bot opened this issue Jan 30, 2024 · 0 comments
Assignees
Labels
T-todo Type: todo todo

Comments

@github-actions
Copy link
Contributor

New Codebase TODO

instead of returning a String, return a ParamType

Location

// TODO: instead of returning a String, return a ParamType

}

/// Given a string (typically a line of decompiled source code), extract a type cast if one exists.
// TODO: instead of returning a String, return a ParamType
/// ```
/// use heimdall_common::ether::evm::core::types::find_cast;
///
/// let line = "uint256(0x000011)";
/// let (range, cast_type) = find_cast(line).expect("failed to find type cast");
/// assert_eq!(range, 8..16);
/// assert_eq!(&line[range], "0x000011");
/// assert_eq!(cast_type, "uint256");
/// ```
pub fn find_cast(line: &str) -> Result<(Range<usize>, String), Error> {
    // find the start of the cast
    match TYPE_CAST_REGEX.find(line).expect("Failed to find type cast.") {
        Some(m) => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-todo Type: todo todo
Projects
None yet
Development

No branches or pull requests

1 participant