HomePhabricator

[backport#16598] test: Remove confusing hash256 function in util

Description

[backport#16598] test: Remove confusing hash256 function in util

Summary:
Moved and renamed hash256 from util.py to zmq_interface.py (Elichai Turkel)

Pull request description:

Right now there are two `hash256(bytes)` in the test framework:
first: https://github.com/bitcoin/bitcoin/blob/master/test/functional/test_framework/util.py#L186
second: https://github.com/bitcoin/bitcoin/blob/master/test/functional/test_framework/messages.py#L60

While they have the same name they're actually doing different things, one just does a sha256d and the other sha256d and reverses the bytes.
so I renamed the second one to be `hash256r` to signify that it's hash256 reversed.

Depends on D7344

Backport of Core PR16598

Test Plan:

ninja check-functional
./test/functional/test_runner.py interface_zmq

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7341

Details

Provenance
fanquake <fanquake@gmail.com>Authored on Aug 14 2019, 06:19
majcostaCommitted on Sep 3 2020, 21:39
majcostaPushed on Sep 3 2020, 21:39
Reviewer
Restricted Project
Differential Revision
D7341: [backport#16598] test: Remove confusing hash256 function in util
Parents
rABC14653a00bd9b: [backport#16404] qa: Test ZMQ notification after chain reorg
Branches
Unknown
Tags
Unknown