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

Improve code for the Combiner role #15

Merged
merged 8 commits into from
Feb 1, 2024
Merged

Improve code for the Combiner role #15

merged 8 commits into from
Feb 1, 2024

Commits on Jan 31, 2024

  1. v0: Improve combine functions

    Add two new macros and refactor the `combine` functions to use them.
    
    Refactor only, no logic changes.
    tcharding committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    d3125bd View commit details
    Browse the repository at this point in the history
  2. v0: Fail to combine non-v0 PSBTs

    It does not make sense to allow our `v0` implementation to combine two
    PSBTs with different versions, error if this is attempted.
    
    While we are at it, move the `CombineError` into `global` because that
    is where it originates. Although this is not important in `v0`, over in
    `v2` there will be different `CombineError`s for the different maps -
    lets be uniform already.
    tcharding committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    b598186 View commit details
    Browse the repository at this point in the history
  3. Add v0::combine

    Add a function `combine` to the `v0` module as we do in `v2`. While we
    are at it make all the docs and calling conventions uniform.
    tcharding committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    2595bb7 View commit details
    Browse the repository at this point in the history
  4. v2: Fail to combine PSBTs with different global fields

    If an attempt is made to combine two PSBTs with different values for the
    global map fields `version` or `tx_version` return an error.
    
    This is in line with what we did in `v0`.
    tcharding committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    3c958a9 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2024

  1. v2: Correctly implement Input::combine

    The current version of `Input::combine` is copied from the `v0` module
    and is not correct for `v2` - fix it.
    tcharding committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    162730c View commit details
    Browse the repository at this point in the history
  2. v2: Use plural for maps

    As we did in other places use plural form for fields in the `Output`
    map.
    tcharding committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    8362792 View commit details
    Browse the repository at this point in the history
  3. v2: Correctly implement Output::combine

    As we did for `v2::Input`.
    
    The current version of `Output::combine` is copied from the `v0` module
    and is not correct for `v2` - fix it.
    tcharding committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    6d6ee6c View commit details
    Browse the repository at this point in the history
  4. Remove unused macro

    We have now fully replaced the usage of this private macro, remove it.
    tcharding committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    c0ce672 View commit details
    Browse the repository at this point in the history