Skip to content

PushBytes::read_scriptint is a bit unwieldy #3479

Closed
@tcharding

Description

@tcharding

While upgrading mininscript to track master branch I found that the PushBytes::read_scriptint function is unwieldy.

Should we add this back in:

/// Decodes an integer in script(minimal CScriptNum) format.
///
/// See [`PushBytes::read_scriptint`] for documentation.
pub fn read_scriptint(v: &[u8]) -> Result<i64, Error> {
    let push = <&PushBytes>::try_from(v).map_err(|_| Error::NumericOverflow)?;
    push.read_scriptint()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions