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
practicalswift
4de11a3682
Remove Python 2 import workarounds
2018-12-13 16:46:31 +01:00
DrahtBot
eb7daf4d60
Update copyright headers to 2018
2018-07-27 07:15:02 -04:00
practicalswift
634bd97001
Explicitly specify encoding when opening text files in Python code
2018-06-12 21:34:52 +02:00
John Bampton
0d31ef4762
Enable W191 and W291 flake8 checks.
...
Remove trailing whitespace from Python files.
Convert tabs to spaces.
2018-05-11 07:59:05 +10:00
practicalswift
f020aca297
Minor Python cleanups to make flake8 pass with the new rules enabled
2018-04-16 17:25:11 +02:00
Akira Takizawa
595a7bab23
Increment MIT Licence copyright header year on files modified in 2017
2018-01-03 02:26:56 +09:00
Douglas Roark
b9d95bd9a1
Fix various minor linearization script issues
...
- The last-timestamp-encountered variable wasn’t being used properly. Rewrite code to properly allow for new blockchain files to be written when split by month.
- Properly set a blockchain file’s access and modify times.
- Add a “debug output” option to quiet certain output that might not always be desirable.
- Update the README.
2017-01-25 13:12:03 -08:00
practicalswift
95bab821b3
Remove unused Python imports
2017-01-13 19:03:20 +01:00
Doug
3c8f63ba7c
Make linearize scripts Python 3-compatible.
2017-01-05 00:46:30 -08:00
Doug
d5aa19813c
Allow linearization scripts to support hash byte reversal
...
Currently, the linearization scripts require input hashes to be in one endian form. Add support for byte reversal.
2017-01-05 00:46:29 -08:00
isle2983
27765b6403
Increment MIT Licence copyright header year on files modified in 2016
...
Edited via:
$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Matthew King
873e81f89b
Use portable #! in python scripts (/usr/bin/env)
2016-06-26 16:47:03 +03:00
Paul Georgiou
e3c42973b2
Update Linearize tool to support Windows paths
2015-07-10 19:21:21 +03:00
Jeff Garzik
7f68c7dc05
contrib/linearize: Support linearization of testnet blocks
2015-05-20 15:27:51 -07:00
sandakersmann
f914f1a746
Added "Core" to copyright headers
...
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Michael Ford
78253fcbad
Remove references to X11 licence
2014-12-16 15:56:50 +08:00
Micha
ebdd6bf30f
Remove genesis block hash from error
2014-12-08 13:55:12 +02:00
Micha
8d174d6b5d
Make several small string fixes in linearize-data.py
...
- Add a space after the fixed string prepended to file names when input or
output file changes
- Clarify the error message when the genesis block is not found in the
hash list (...why do we have this at all?)
2014-12-07 17:55:53 +02:00
Wladimir J. van der Laan
aedc74dfa6
contrib: make linearize-data.py cope with out-of-order blocks
...
Make it possible to read blocks in any order. This will be required
after headers-first (#4468 ), so should be merged before that.
- Read block header. For expected blocks, continue, else skip.
- For in-order blocks: copy block contents directly. Write prior
out-of-order blocks if this connects a consecutive span.
- For out-of-order blocks, store extents of block data for later
retrieval. Cache out-of-order blocks in memory up to 100MB
(configurable).
2014-10-06 18:30:12 +02:00
Suhas Daftuar
07d5287f42
Catch error when done reading files
2014-09-11 09:22:39 -04:00
Jeff Garzik
399cdbc700
contrib/linearize: Add feature to set file's timestamp based on block header time.
2014-09-04 15:13:37 +02:00
Jeff Garzik
8f5a423344
contrib/linearize: split block files based on year-month, not just year
2014-08-24 01:40:40 -04:00
Jeff Garzik
75400a2a41
contrib/linearize: Guarantee that output is generated in-order
...
This was typically ensured implicitly by virtue of normal bitcoind
operation. Adding an explicit check provides a stronger guarantee, and
it is cheap to add.
2014-08-24 01:18:24 -04:00
Jeff Garzik
b4a72a75b4
contrib/linearize: split output files based on new-timestamp-year or max-file-size
2014-08-23 22:59:16 -04:00
Jeff Garzik
476eb7eb53
Update linearize scripts.
...
Break into two steps:
* Generate hash list
* Build data file(s) from local bitcoind blocks/ directory.
This supports building one large bootstrap.dat, or multiple
smaller blocks/blkNNNNN.dat files.
2014-08-23 21:46:12 -04:00