-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat(sighash): implement sighash range [part 3/7] #913
base: tests/sighash/bitmask
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## tests/sighash/bitmask #913 +/- ##
========================================================
Coverage ? 85.43%
========================================================
Files ? 289
Lines ? 22584
Branches ? 3410
========================================================
Hits ? 19295
Misses ? 2614
Partials ? 675 ☔ View full report in Codecov by Sentry. |
78b027b
to
1b44d48
Compare
c3467a9
to
479cb8a
Compare
1b44d48
to
fc82733
Compare
479cb8a
to
b815b65
Compare
2bf7549
to
ad1def9
Compare
b815b65
to
e2a9b75
Compare
hathor/transaction/scripts/opcode.py
Outdated
output_start=bytes_to_int(output_start), | ||
output_end=bytes_to_int(output_end), | ||
) | ||
except Exception as e: |
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.
Why are you capturing Exception
instead of the specific exception types?
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.
I changed it as explained in #911 (comment)
@@ -60,7 +60,37 @@ def _get_indexes(bitmask: int) -> list[int]: | |||
return [index for index in range(8) if (bitmask >> index) & 1] | |||
|
|||
|
|||
SighashType: TypeAlias = SighashAll | SighashBitmask | |||
class SighashRange(CustomSighash): | |||
"""A model representing the sighash range type config. Range ends are not inclusive.""" |
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.
Shouldn't range ends be included? I feel it's more intuitive than not including them.
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.
I think it's intuitive like this when you include the whole range, which would be from 0 to 255, which is the max number of inputs/outputs. If we do it inclusive, the user would have to set 254 to include the whole range. I can change it if you want.
ad1def9
to
890c630
Compare
e2a9b75
to
d7aa643
Compare
d7aa643
to
887a8a7
Compare
Depends on #912
Motivation
Implement the new sighash range opcode.
Acceptance Criteria
SighashRange
model.op_sighash_range()
function.