Many functional tests still use magic numbers for inventory types, either passed to the CInv
constructor or for comparing the type
member of CInv
. This PR replaces all of those by constants in the module test_framework.messages
that have been introduced in commit c32cf9f62285b5cd18a5064aee91f0802f0f87a8: MSG_TX
(1) or MSG_BLOCK
(2).
It also introduces a new constant MSG_CMPCT_BLOCK
(naming as in src/protocol.h
) and uses it to replace the remaining magic numbers.
The occurences of the magic numbers were identified through grep
ing for CInv(
and type ==
. The idea was first to create a scripted-diff, but since also adding missing import
s is needed, this would be non-trivial. Besides, also some unneeded comments like # 2 == "Block"
could be removed.