unchained-capital / hermit

Command-line, (SLIP39) sharded wallet designed for air-gapped deployments
https://unchained.com
Apache License 2.0
70 stars 29 forks source link

Bech32 outputs #28

Closed destrys closed 4 years ago

destrys commented 4 years ago

This PR gives hermit the ability to sign transaction with bech32 outputs (both p2wsh and p2wpkh). An on-chain testnet transaction has been added to the fixtures.

The signing code didn't need to change, thanks to python-bitcoinlib adding bech32 addresses with release 0.11.0. Our validation function did need to be updated. Note that python-bitcoinlib doesn't differentiate between an incorrect network, an invalid checksum, or an invalid string for bech32 decoding, so for all these cases we return the same error message.

codecov-io commented 4 years ago

Codecov Report

Merging #28 into master will increase coverage by 0.1%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #28     +/-   ##
=========================================
+ Coverage   57.73%   57.83%   +0.1%     
=========================================
  Files          25       25             
  Lines        1235     1238      +3     
  Branches      168      168             
=========================================
+ Hits          713      716      +3     
  Misses        504      504             
  Partials       18       18
Impacted Files Coverage Δ
hermit/signer/bitcoin_signer.py 100% <100%> (ø) :arrow_up:

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 3ac8d30...89c89bd. Read the comment docs.