Skip to content

Commit bdf95e1

Browse files
[pre-commit.ci] pre-commit autoupdate (#95)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/PyCQA/docformatter: v1.5.1 → v1.6.0.rc1](PyCQA/docformatter@v1.5.1...v1.6.0.rc1) - [github.com/pycqa/pydocstyle: 6.2.3 → 6.3.0](PyCQA/pydocstyle@6.2.3...6.3.0) - [github.com/pycqa/pylint: v2.15.10 → v2.16.0b1](pylint-dev/pylint@v2.15.10...v2.16.0b1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c8acd88 commit bdf95e1

20 files changed

+19
-31
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ repos:
7070
language: python
7171
types: [python]
7272
- repo: https://github.com/PyCQA/docformatter
73-
rev: v1.5.1
73+
rev: v1.6.0.rc1
7474
hooks:
7575
- id: docformatter
7676
description: "Formats docstrings to follow PEP 257."
@@ -84,7 +84,7 @@ repos:
8484
language: python
8585
types: [python]
8686
- repo: https://github.com/pycqa/pydocstyle
87-
rev: 6.2.3
87+
rev: 6.3.0
8888
hooks:
8989
- id: pydocstyle
9090
additional_dependencies: [tomli]
@@ -138,7 +138,7 @@ repos:
138138
language: python
139139
types: [python]
140140
- repo: https://github.com/pycqa/pylint
141-
rev: v2.15.10
141+
rev: v2.16.0b1
142142
hooks:
143143
- id: pylint
144144
args: [

btclib/block/block.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ def vsize(self) -> int:
5050
def height(self) -> int | None:
5151
"""Return the height committed into a BIP34 coinbase script_sig.
5252
53-
Version 2 blocks commit block height into the coinbase script_sig.
53+
Version 2 blocks commit block height into the coinbase
54+
script_sig.
5455
5556
https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki
56-
5757
Block 227,835 (2013-03-24 15:49:13 GMT) was the last version 1 block.
5858
"""
5959
if not self.transactions[0].is_coinbase():

btclib/block/block_header.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def difficulty(self) -> float:
7070
7171
It represents the average number of hash function evaluations
7272
required to satisfy the BlockHeader target,
73-
expressed as multiple of the genesis block difficulty used as unit.
73+
expressed as multiple of the genesis block difficulty used as
74+
unit.
7475
7576
The difficulty of the genesis block is 2^32 (4*2^30),
7677
i.e. 4 GigaHash function evaluations.

btclib/ec/curve_group.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,8 @@ def mult_mont_ladder(m: int, Q: JacPoint, ec: CurveGroup) -> JacPoint:
530530
Jacobian coordinates.
531531
532532
It is constant-time and resistant to the FLUSH+RELOAD attack,
533-
(see https://eprint.iacr.org/2014/140.pdf)
533+
(see
534+
https://eprint.iacr.org/2014/140.pdf)
534535
as it prevents branch prediction avoiding any if.
535536
536537
The input point is assumed to be on curve and
@@ -675,8 +676,8 @@ def _double_mult(
675676
Strauss algorithm consists of a single 'double & add' loop
676677
for the parallel calculation of u*H and v*Q, efficiently
677678
using a single 'doubling' for both scalar multiplications (see
678-
https://stackoverflow.com/questions/50993471/ec-scalar-multiplication-with-strauss-shamir-method).
679679
680+
https://stackoverflow.com/questions/50993471/ec-scalar-multiplication-with-strauss-shamir-method).
680681
The Shamir trick adds the precomputation of H+Q,
681682
which is to be added in the loop when the binary digits
682683
of u and v are both equal to 1 (on average 1/4 of the cases).

btclib/ecc/dh.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def ansi_x9_63_kdf(z: bytes, size: int, hf: HashF, shared_info: bytes | None) ->
3434
Return a keying data octet sequence of the requested size according
3535
to ANSI-X9.63-KDF specifications for the key derivation function.
3636
37-
http://www.secg.org/sec1-v2.pdf, section 3.6.1
37+
http://www.secg.org/sec1-v2.pdf,
38+
section 3.6.1
3839
"""
3940
hf_size = hf().digest_size
4041
max_size = hf_size * (2**32 - 1)

btclib/number_theory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def mod_inv(a: int, m: int) -> int:
4646
m does not have to be a prime.
4747
4848
Based on Extended Euclidean Algorithm, see:
49+
4950
https://en.wikibooks.org/wiki/Algorithm_Implementation/Mathematics/Extended_Euclidean_algorithm
5051
"""
5152
a %= m

btclib/psbt/psbt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ def extract_tx(psbt: Psbt, check_validity: bool = True) -> Tx:
439439
The Transaction Extractor must only accept a PSBT.
440440
It checks whether all inputs have complete scriptSigs
441441
and scriptWitnesses by checking for the presence of
442-
0x07 Finalized scriptSig and 0x08 Finalized scriptWitness typed records.
442+
0x07 Finalized scriptSig and 0x08 Finalized scriptWitness typed
443+
records.
443444
444445
If they do, the Transaction Extractor should construct
445446
complete scriptSigs and scriptWitnesses and encode them

btclib/tx/tx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
vin (list[TxIn]), and vout (list[TxOut]).
1515
1616
https://en.bitcoin.it/wiki/Transaction
17-
https://learnmeabitcoin.com/guide/coinbase-transaction
17+
https://learnmeabitcoin.com/guide/coinbase-transaction
1818
https://bitcoin.stackexchange.com/questions/20721/what-is-the-format-of-the-coinbase-transaction
1919
2020
For TxIn.sequence and TX.lock_time see:
2121
https://developer.bitcoin.org/devguide/transactions.html
22-
https://medium.com/summa-technology/bitcoins-time-locks-27e0c362d7a1
22+
https://medium.com/summa-technology/bitcoins-time-locks-27e0c362d7a1
2323
https://bitcoin.stackexchange.com/questions/40764/is-my-understanding-of-locktime-correct
2424
https://en.bitcoin.it/wiki/Timelock
2525
"""

btclib/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def int_from_bits(octets: Octets, nlen: int) -> int:
8282
bits on the left, while int_from_bits will discard some bits on the
8383
right. i.to_bytes is the reverse of int_from_bits only when
8484
nlen is a multiple of 8 and bit sequences already have length nlen.
85-
See https://tools.ietf.org/html/rfc6979#section-2.3.5.
85+
See
86+
https://tools.ietf.org/html/rfc6979#section-2.3.5.
8687
"""
8788
octets = bytes_from_octets(octets)
8889
i = int.from_bytes(octets, byteorder="big", signed=False)

tests/bip32/test_bip32.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ def test_invalid_bip32_xkeys() -> None:
184184
185185
https://github.com/bitcoin/bips/pull/921
186186
"""
187-
188187
filename = path.join(data_folder, "bip32_invalid_keys.json")
189188
with open(filename, encoding="ascii") as file_:
190189
test_vectors = json.load(file_)
@@ -356,7 +355,6 @@ def test_crack() -> None:
356355

357356
def test_bips_pr905() -> None:
358357
"""Https://github.com/bitcoin/bips/pull/905."""
359-
360358
seed = "57fb1e450b8afb95c62afbcd49e4100d6790e0822b8905608679180ac34ca0bd45bf7ccc6c5f5218236d0eb93afc78bd117b9f02a6b7df258ea182dfaef5aad7"
361359
xroot = rootxprv_from_seed(seed)
362360
der_path = "m/44H/60H/0H"

0 commit comments

Comments
 (0)