This PR tries to make the __repr__
methods for messages and primitives more consistent in test/functional/test_framework/messages.py
by making repr
return a string with a valid constructor call to the message/primitive if that is possible, or returning information in angle brackets to show the internal state of the message/primitive.
Also, all hashes and other hex data is prefixed with “0x” and the correct minimum length of the hex string is set with the format string. I think the leading “0x” can be useful since then it is obvious what is an integer vs. hex. These functions are only used for logging, so this is meant to make it clearer how to reconstruct an object if necessary and what the size of the printed hex types are.