feat: add transaction input/output mutation methods#177
Open
shivv23 wants to merge 1 commit into
Open
Conversation
Add add_input, add_output, remove_input, remove_output, update_input, and update_output methods to the Transaction class. - add_input/remove_input automatically manage the segwit witness list to keep it parallel with inputs, answering the maintainer's TODO: 'influences set_witness (add_input should add the empty witness immediately?)' - remove_input/remove_output/update_input/update_output raise IndexError for out-of-bounds access, matching Python list semantics - 40 tests covering all methods, round-trip serialization, and edge cases (empty tx, segwit/non-segwit, negative indices, copy isolation) Closes the main item on the project TODO list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds 6 mutation methods to the Transaction class, directly addressing the TODO list priority item:
All remove/update methods raise IndexError on out-of-bounds access, matching Python stdlib list semantics.
Testing
Related
Closes the main TODO item: influences set_witness (add_input should add the empty witness immediately?)