lbrycrd/test/functional/test_framework
MarcoFalke fa6bf21f5e
scripted-diff: test: Use py3.5 bytes::hex() method
-BEGIN VERIFY SCRIPT-
sed -i -e "s/def bytes_to_hex_str/def b_2_x/g" $(git grep -l bytes_to_hex_str)

export RE_B_0="[^()]*"                          # match no bracket
export RE_B_1="${RE_B_0}\(${RE_B_0}\)${RE_B_0}" # match exactly one ()
export RE_B_2="${RE_B_0}\(${RE_B_1}\)${RE_B_0}" # match wrapped (())

export RE_M="(b2x|bytes_to_hex_str)\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\)"

sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g"      $(git grep -l -E '(b2x|bytes_to_hex_str)')

sed -i --regexp-extended -e "/  +bytes_to_hex_str( as b2x)?,/d"    $(git grep -l bytes_to_hex_str)
sed -i --regexp-extended -e "s/ +bytes_to_hex_str( as b2x)?,//g"   $(git grep -l bytes_to_hex_str)
sed -i --regexp-extended -e "s/, bytes_to_hex_str( as b2x)?//g"    $(git grep -l bytes_to_hex_str)

export RE_M="(binascii\.)?hexlify\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\).decode\(${RE_B_0}\)"

sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l hexlify -- ':(exclude)share')

sed -i --regexp-extended -e  "/from binascii import hexlify$/d" $(git grep -l hexlify -- ':(exclude)share')
sed -i --regexp-extended -e "s/(from binascii import) .*hexlify/\1 unhexlify/g" $(git grep -l hexlify -- ':(exclude)share')

sed -i -e 's/ignore-names "/ignore-names "b_2_x,/g' ./test/lint/lint-python-dead-code.sh
-END VERIFY SCRIPT-
2019-03-02 10:40:12 -05:00
..
__init__.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
address.py scripted-diff: test: Use py3.5 bytes::hex() method 2019-03-02 10:40:12 -05:00
authproxy.py tests: Make it possible to run functional tests on Windows 2018-09-17 09:56:49 +08:00
bignum.py Remove unused variables and/or function calls 2017-08-28 15:18:14 +02:00
blocktools.py scripted-diff: test: Use py3.5 bytes::hex() method 2019-03-02 10:40:12 -05:00
coverage.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
descriptors.py Descriptor checksum 2019-02-15 22:36:05 -08:00
key.py tests: Remove compatibility code not needed now when we're on Python 3 2018-04-16 09:54:27 +02:00
messages.py scripted-diff: test: Use py3.5 bytes::hex() method 2019-03-02 10:40:12 -05:00
mininode.py qa: Add tests for invalid message headers 2019-01-24 17:08:22 -05:00
netutil.py scripted-diff: test: Use py3.5 bytes::hex() method 2019-03-02 10:40:12 -05:00
script.py scripted-diff: test: Use py3.5 bytes::hex() method 2019-03-02 10:40:12 -05:00
segwit_addr.py Use BIP173 addresses in segwit.py test 2017-09-28 17:29:01 -07:00
siphash.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
socks5.py tests: Remove unused testing code 2018-11-07 18:07:49 +01:00
test_framework.py test: Simplify create_cache 2019-02-25 11:18:24 -05:00
test_node.py qa: Remove mocktime unless required 2019-02-19 10:43:58 -05:00
util.py scripted-diff: test: Use py3.5 bytes::hex() method 2019-03-02 10:40:12 -05:00
wallet_util.py [tests] move wallet util functions to wallet_util.py 2019-01-04 17:49:17 -08:00