-
Notifications
You must be signed in to change notification settings - Fork 35.7k
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: remove unneeded bytes<->hex conversions in byte_to_base58
#24324
Merged
maflcko
merged 1 commit into
bitcoin:master
from
theStack:202202-test-refactor_simplify-byte_to_base58
Feb 15, 2022
Merged
test: refactor: remove unneeded bytes<->hex conversions in byte_to_base58
#24324
maflcko
merged 1 commit into
bitcoin:master
from
theStack:202202-test-refactor_simplify-byte_to_base58
Feb 15, 2022
Conversation
This file contains 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
35ad44b
to
6967579
Compare
byte_to_base58
byte_to_base58
shaavan
approved these changes
Feb 12, 2022
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.
laanwj
reviewed
Feb 14, 2022
laanwj
reviewed
Feb 14, 2022
@@ -55,17 +55,15 @@ def create_deterministic_address_bcrt1_p2tr_op_true(): | |||
|
|||
def byte_to_base58(b, version): | |||
result = '' | |||
str = b.hex() |
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.
Oof, this was some terrible python code, thanks for improving it 😄
…ase58` It seems like the only reason for using hex strings in this method was to have a convenient way to convert to an integer from the input data interpreted as big-endian. In Python3 we have `int.from_bytes(..., 'big')` for that purpose, hence there is no need for that anymore and we can simply operate on bytes only.
6967579
to
f11dad2
Compare
Code review ACK f11dad2 |
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Feb 15, 2022
…ersions in `byte_to_base58` f11dad2 test: refactor: remove unneeded bytes<->hex conversions in `byte_to_base58` (Sebastian Falbesoner) Pull request description: It seems like the only reason for using hex strings in this method was to have a convenient way to convert to an integer from the input data interpreted as big-endian. In Python3 we have `int.from_bytes(..., 'big')` for that purpose, hence there is no need for that anymore and we can simply operate on bytes only. ACKs for top commit: laanwj: Code review ACK f11dad2 Tree-SHA512: 9b1563010066ca74d85139c3b9259e9a5bb49e1f141c30b6506a0445afddb2bde7fd421fdd917dc516956e66f93610e2c21d720817640daee8f57f803be76ee4
Fabcien
pushed a commit
to Bitcoin-ABC/bitcoin-abc
that referenced
this pull request
Mar 7, 2022
…ase58` Summary: It seems like the only reason for using hex strings in this method was to have a convenient way to convert to an integer from the input data interpreted as big-endian. In Python3 we have `int.from_bytes(..., 'big')` for that purpose, hence there is no need for that anymore and we can simply operate on bytes only. This is a backport of [[bitcoin/bitcoin#24324 | core#24324]] Depends on D11136 Test Plan: `ninja check-functional-extended` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D11138
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
It seems like the only reason for using hex strings in this method was to have a convenient way to convert to an integer from the input data interpreted as big-endian. In Python3 we have
int.from_bytes(..., 'big')
for that purpose, hence there is no need for that anymore and we can simply operate on bytes only.