richardkiss / pycoin

Python-based Bitcoin and alt-coin utility library.
MIT License
1.4k stars 497 forks source link

Add segwit xpub support #380

Closed jusasiiv closed 3 years ago

jusasiiv commented 3 years ago

This is in reference of Issue #251. This PR is based on work done earlier by @shivaenigma and @freenancial

At this point this PR handles yPub/zPub (BIP49 and BIP84) address parsing, but some work in this PR is needed before talking about merge. I am in need of some help structuring the code correctly and I am asking if @richardkiss would have a moment to help me put the final pieces to correct places and correct any possible glaring mistakes I might have done.

What I am thinking is in BIP32Node.py the overriding address() function, especially the P2WPKH-in-P2SH code should be moved to a better location but I am unsure of where.

codecov-io commented 3 years ago

Codecov Report

Merging #380 (4f23d73) into master (9837d45) will decrease coverage by 0.22%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #380      +/-   ##
==========================================
- Coverage   87.96%   87.74%   -0.23%     
==========================================
  Files         217      217              
  Lines       10015    10022       +7     
==========================================
- Hits         8810     8794      -16     
- Misses       1205     1228      +23     
Impacted Files Coverage Δ
pycoin/networks/AddressAPI.py 100.00% <ø> (ø)
pycoin/symbols/btc.py 100.00% <ø> (ø)
pycoin/key/BIP32Node.py 91.60% <100.00%> (+3.51%) :arrow_up:
pycoin/networks/ParseAPI.py 95.34% <100.00%> (+0.32%) :arrow_up:
pycoin/networks/bitcoinish.py 97.23% <100.00%> (+0.05%) :arrow_up:
tests/keyparser_test.py 100.00% <100.00%> (ø)
tests/key_test.py 56.52% <0.00%> (-41.31%) :arrow_down:
pycoin/key/Key.py 85.96% <0.00%> (-3.70%) :arrow_down:
pycoin/coins/TxIn.py 60.00% <0.00%> (-3.64%) :arrow_down:
pycoin/coins/TxOut.py 60.00% <0.00%> (-3.64%) :arrow_down:
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9837d45...4f23d73. Read the comment docs.

richardkiss commented 3 years ago

Fixed in 7180aa49878a5a189d99633c474138d547390c3d