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

Parse int error #1129

Merged
merged 2 commits into from
Jul 28, 2022
Merged

Parse int error #1129

merged 2 commits into from
Jul 28, 2022

Commits on Jul 27, 2022

  1. Extend ParseIntError to carry more context

    When debugging parsing errors it's very useful to know some context:
    what the input was and what integer type was parsed. `ParseIntError`
    from `core` doesn't contain this information.
    
    In this commit a custom `ParseIntError` type is crated that carries the
    one from `core` as well as additional information. Its `Display`
    implementation displays this additional information as a well-formed
    English sentence to aid users with understanding the problem. A helper
    function parses any integer type from common string types returning the
    new `ParseIntError` type on error.
    
    To clean up the error code a bit some new macros are added and used.
    New modules are added to organize the types, functions and macros.
    
    Closes rust-bitcoin#1113
    Kixunil committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    c39bc39 View commit details
    Browse the repository at this point in the history
  2. Implement string parsing for Sequence

    `Sequence` didn't have `FromStr` nor `TryFrom<{stringly type}>`
    implemented by accident. This moves a macro for implementing them from
    `locktime` module to the `parse` module, renames it for clarity and uses
    it to implement parsing for `Sequence`.
    Kixunil committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    071a1c0 View commit details
    Browse the repository at this point in the history