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

Add transaction::Version data type #2006

Merged
merged 1 commit into from
Sep 23, 2023

Commits on Sep 21, 2023

  1. Add transaction::Version data type

    BIP-68 activated a fair while ago (circa 2019) and since then only
    transaction versions 1 and 2 have been considered standard.
    
    Currently in our `Transaction` struct we use an `i32`, this means users
    can construct a non-standard transaction if they do not first look up
    what the value should be. We can help folk out here by abstracting over
    the version number.
    
    Since the version number only governs standardness elect to make the
    inner `i32` public (ie., not an invariant). The aim of the type is to
    make life easy not restrict what versions are used.
    
    Add transaction::Version data type that simply provides two consts `ONE`
    and `TWO`.
    
    Add a `Default` impl on `Version` that returns `Version::TWO`.
    
    In tests that used version 0, instead use `Version::default` because the
    test obviously does not care.
    tcharding committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    c950ef4 View commit details
    Browse the repository at this point in the history