-
Notifications
You must be signed in to change notification settings - Fork 37.7k
test: refactor: dedup code by taking use of create_block
parameters
#23521
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
test: refactor: dedup code by taking use of create_block
parameters
#23521
Conversation
4121983
to
06cb276
Compare
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
06cb276
to
66e97bd
Compare
Rebased on master. |
66e97bd
to
397f6cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other, too?
Passing a list of transactions `txlist` to `create_block` appends them to the block, hence we don't need to do that manually anymore. The merkle root calculation can also be removed, since this is done in the end of the helper.
397f6cb
to
e57c0eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested ACK e57c0eb.
The helper
create_block
offers two parametersversion
andtxlist
which set thenVersion
field / extend thevtx
array of the block, respectively. By taking use of those, we can remove a lot of code, including the recalculation of the merkle root. Both passing txs in string andCTransaction
format is supported, i.e. we also save potential calls totx_from_hex
.The PR also contains another commit which replaces magic numbers for OP_TRUE/OP_1 (0x51) with the proper constant from the
script
module.Instances setting the block version of 4 explicitely after calling
create_block
are removed, as this is the default since #16333 got merged (see #23521 (comment)).