Skip to content

Commit 19ffc2f

Browse files
MarcoFalkevijaydasmp
authored andcommitted
Merge bitcoin#23723: test: Replace hashlib.new with named constructor
fa1b63c test: Replace hashlib.new with named constructor (MarcoFalke) Pull request description: A small refactor that doesn't matter too much, but it using the named constructor is nice because: * It clarifies that it is a built-in function * It is (trivially) faster and less code. ACKs for top commit: Zero-1729: ACK fa1b63c w0xlt: ACK fa1b63c Tree-SHA512: d23dc4552c1e6fc1f90f8272e47e4efcbe727f0b66a6f6a264db8a50ee6cb6d57a2809befcb95fda6725136672268633817a03dd1859f2298d20e3f9e0ca4a7f
1 parent c600e90 commit 19ffc2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/test_framework/messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161

6262
FILTER_TYPE_BASIC = 0
6363

64-
# Serialization/deserialization tools
6564
def sha256(s):
66-
return hashlib.new('sha256', s).digest()
65+
return hashlib.sha256(s).digest()
66+
6767

6868

6969
def hash256(s):

0 commit comments

Comments
 (0)