Skip to content

Commit

Permalink
Merge bitcoin#23723: test: Replace hashlib.new with named constructor
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MarcoFalke authored and vijaydasmp committed Sep 7, 2024
1 parent 07b8aac commit cba2d77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/functional/test_framework/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@

FILTER_TYPE_BASIC = 0

# Serialization/deserialization tools
def sha256(s):
return hashlib.new('sha256', s).digest()
return hashlib.sha256(s).digest()



def hash256(s):
Expand Down

0 comments on commit cba2d77

Please sign in to comment.