<!-- Needs the label "good first issue" assigned manually before or after opening -->

<!-- A good first issue is an uncontroversial issue, that has a relatively unique and obvious solution -->

<!-- Motivate the issue and explain the solution briefly -->
Right now in the functional test framework, conversions from hex-string to bytes and vice-versa are done in different ways:
- convert `bytes_obj` to hex-string: binascii.hexlify(bytes_obj), bytes_obj.hex()
- convert `hex_str` to bytes object: binascii.unhexlify(hex_str), binascii.a2b_hex(hex_str), bytes.fromhex(hex_str)

For consistency reasons, only the built-in way of using `bytes` (class) methods should be used (see also MarcoFalke's comment https://github.com/bitcoin/bitcoin/pull/22593#issuecomment-890918620):
- bytes.fromhex() (https://docs.python.org/3.7/library/stdtypes.html#bytes.fromhex)
- bytes.hex() (https://docs.python.org/3.7/library/stdtypes.html#bytes.hex)

This seems to be the most natural and modern way to do it, without a need to import any libraries, and the other ones using binascii should be replaced by those. As an example, see PR #22593 which replaced a helper `hex_str_to_bytes` (which in turn used binascii.unhexlify) with `bytes.fromhex()`. For quickly identifying instances the command `git grep binascii` can be used, though one would need to check that there is maybe uses of binascii that are still legit.

#### Useful skills:
- Python 3 basic skills, knowledge of fundamental data types string and bytes

#### Want to work on this issue?

For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md) before opening your pull request.

}
        }
    }
}
/*
Python code to generate the below hashes:
    def reversed_hex(x):
        return binascii.hexlify(''.join(reversed(x)))
    def dsha256(x):
        return hashlib.sha256(hashlib.sha256(x).digest()).digest()
    reversed_hex(dsha256(''.join(struct.pack('<d', x) for x in range(0,1000)))) == '43d0c82591953c4eafe114590d392676a01585d25b25d433557f0d7878b23f96'
*/
BOOST_AUTO_TEST_CASE(doubles)
{
    CDataStream ss(SER_DISK, 0);
    
    for (int i = 0; i < 1000; i++) {
        ss << EncodeDouble(i);
    }
    BOOST_CHECK(Hash(ss) == uint256S("43d0c82591953c4eafe114590d392676a01585d25b25d433557f0d7878b23f96"));
    
    for (int i = 0; i < 1000; i++) {
        uint64_t val;
        ss >> val;
        double j = DecodeDouble(val);
        BOOST_CHECK_MESSAGE(i == j, "decoded:" << j << " expected:" << i);
    }
}
BOOST_AUTO_TEST_SUITE_END()