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

Enable ordered outputs for OP_RETURN use cases (SLP...) #298

Merged
merged 4 commits into from
May 22, 2023

Commits on May 19, 2023

  1. split shuffle_inputs_outputs

    We want to be able to disable one without necessarily disabling the other.
    PiRK committed May 19, 2023
    Configuration menu
    Copy the full SHA
    f3acde0 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2023

  1. transaction: introduce TxOutput namedtuple

    Using a namedtuple is an intermediate step before creating a proper class for this. It encapsulate the 3-tuples and makes the code easier to read (attributes rather than indices)
    
    backport of spesmilo#4596 and removal of a bunch of code Transaction methods that are unused.
    PiRK committed May 22, 2023
    Configuration menu
    Copy the full SHA
    9d9de27 View commit details
    Browse the repository at this point in the history
  2. alway put op_return as the first output

    There are use cases that require the op_return to be the first output in a transaction (e.g. SLP), and I'm not aware of any use case that requires it to not be in that position.
    PiRK committed May 22, 2023
    Configuration menu
    Copy the full SHA
    3c1ed6a View commit details
    Browse the repository at this point in the history
  3. add a checkbox to disable shuffling the outputs when using op_return

    The intended use case for this is sending SLP token using a hex encoded op_return payload.
    
    Test plan:
    Check that the new checkbox is only enabled if something is typed into the op_return payload field, and disabled when this payload is deleted.
    
    Add multiple outputs in the send tab, leave the op_return field blank. Click "Preview" multiple times and make sure the outputs are shuffled (no matter if the new checkbox is checked or not).
    
    Type something in the op_return field, and repeat the above test. Now the shuffling behavior must depend on the checkbox. The op_return output should always be first. The other outputs should be shuffled if the checkbox is checked. If it is unchecked, then the change output must be last, and preceded by the other outputs in the specified order.
    
    Click send and check the order in a block explorer.
    PiRK committed May 22, 2023
    Configuration menu
    Copy the full SHA
    22b5d08 View commit details
    Browse the repository at this point in the history