mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-27 15:28:49 +02:00
Merge bitcoin/bitcoin#22633: refactor: Replace remaining binascii method calls
021daedfa1refactor: replace remaining binascii method calls (Zero-1729) Pull request description: This PR removes the remaining `binascii` method calls outside `test/functional` and `test_framework`, as pointed out here https://github.com/bitcoin/bitcoin/pull/22619#pullrequestreview-722153458. Follow-up to #22593 and #22619 Closes #22605 ACKs for top commit: josibake: re-ACK021daedfa1theStack: re-ACK021daedfa1Tree-SHA512: 2ae9fee8917112c91a5406f219ca70f24cd8902b903db5a61fc2de85ad640d669a772f5c05970be0fcee6ef1cdd32fae2ca5d1ec6dc9798b43352c8160ddde6f
This commit is contained in:
@@ -19,7 +19,6 @@ Classes use __slots__ to ensure extraneous attributes aren't accidentally added
|
||||
by tests, compromising their intended effect.
|
||||
"""
|
||||
from base64 import b32decode, b32encode
|
||||
from codecs import encode
|
||||
import copy
|
||||
import hashlib
|
||||
from io import BytesIO
|
||||
@@ -681,7 +680,7 @@ class CBlockHeader:
|
||||
r += struct.pack("<I", self.nBits)
|
||||
r += struct.pack("<I", self.nNonce)
|
||||
self.sha256 = uint256_from_str(hash256(r))
|
||||
self.hash = encode(hash256(r)[::-1], 'hex_codec').decode('ascii')
|
||||
self.hash = hash256(r)[::-1].hex()
|
||||
|
||||
def rehash(self):
|
||||
self.sha256 = None
|
||||
|
||||
Reference in New Issue
Block a user