Skip to content

Commit

Permalink
Fix: Semantics and update HDWallet example components.
Browse files Browse the repository at this point in the history
  • Loading branch information
meherett committed Oct 24, 2021
1 parent 3993880 commit d38c77b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
2 changes: 0 additions & 2 deletions examples/from_private_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
print("Public Key:", hdwallet.public_key())
print("Wallet Important Format:", hdwallet.wif())
print("Finger Print:", hdwallet.finger_print())
print("Semantic:", hdwallet.semantic())
print("Path:", hdwallet.path())
print("Hash:", hdwallet.hash())
print("P2PKH Address:", hdwallet.p2pkh_address())
print("P2SH Address:", hdwallet.p2sh_address())
Expand Down
1 change: 0 additions & 1 deletion examples/from_public_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
print("Compressed:", hdwallet.compressed())
print("Public Key:", hdwallet.public_key())
print("Finger Print:", hdwallet.finger_print())
print("Semantic:", hdwallet.semantic())
print("Hash:", hdwallet.hash())
print("P2PKH Address:", hdwallet.p2pkh_address())
print("P2SH Address:", hdwallet.p2sh_address())
Expand Down
2 changes: 0 additions & 2 deletions examples/from_wif.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
print("Public Key:", hdwallet.public_key())
print("Wallet Important Format:", hdwallet.wif())
print("Finger Print:", hdwallet.finger_print())
print("Semantic:", hdwallet.semantic())
print("Path:", hdwallet.path())
print("Hash:", hdwallet.hash())
print("P2PKH Address:", hdwallet.p2pkh_address())
print("P2SH Address:", hdwallet.p2sh_address())
Expand Down
6 changes: 3 additions & 3 deletions examples/from_xprivate_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
XPRIVATE_KEY: str = "xprv9s21ZrQH143K24t96gCaezzt1QQmnqiEGm8m6TP8yb8e3TmGfkCgcLEVss" \
"kufMW9R4KH27pD1kyyEfJkYz1eiPwjhFzB4gtabH3PzMSmXSM"
# Bitcoin non-root xprivate key
# XPRIVATE_KEY: str = "xprvA3KRgVDh45mbQT1VmWPx73YeAWM4629Q2D9pMuqjFMnjTqDGhKiww6H532rg" \
# "YRNj37fngd4Mvp7GfUD8rKeQzUZjCWeisT92tX8FfjWx3BL"
# XPRIVATE_KEY: str = "yprvAMZNWbcSVmxMiVoKgQuKmemTpEz8dJs3v8hmgkRVUjncqkXsgoxyqZ8rDb" \
# "eXzMqRQZEsTcB4T5iQQx7WazLyy3KiHZrdcHo6DmGAibeMxQV"

if STRICT:
# Check root xprivate key
assert is_root_xprivate_key(xprivate_key=XPRIVATE_KEY, symbol=BTC, semantic="p2pkh"), "Invalid root xprivate key."
assert is_root_xprivate_key(xprivate_key=XPRIVATE_KEY, symbol=BTC), "Invalid Root XPrivate Key."

# Initialize Bitcoin mainnet HDWallet
hdwallet: HDWallet = HDWallet(symbol=BTC)
Expand Down
6 changes: 3 additions & 3 deletions examples/from_xpublic_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
XPUBLIC_KEY: str = "xpub661MyMwAqRbcEqD3v24ZWHGDMqqAfbDbmnUFJXfbpxGZaAshq7evA7fB75CHFbNHSot" \
"LadDZw6M6ic4ZkdN6jQ2KMGR66Z2EybgdLFjNrpf"
# Bitcoin non-root xpublic key
# XPUBLIC_KEY: str = "xpub6FbWJtnc3eJHBwfTqhaE9yQNkmi56UDy9Rm1pbhvuSSigr6xKihuFpnnf4jz8G9ba2m3wFaF" \
# "Gj7eH7FE451Jo5hPJhbaCdmxoBwWbFzk1Sn"
# XPUBLIC_KEY: str = "zpub6uxKjJ8pnanQKU2betFrDPVmcVUvVgyAhgWS74iaN7yUE8RADoRRnztyVEQtnzi9Fh1Vp" \
# "6iJ8RT6mMqjGnS6AxGjud3P2DLzpMHUw2zT1n2"

if STRICT:
# Check root xpublic key
assert is_root_xpublic_key(xpublic_key=XPUBLIC_KEY, symbol=BTC, semantic="p2pkh"), "Invalid root xpublic key."
assert is_root_xpublic_key(xpublic_key=XPUBLIC_KEY, symbol=BTC), "Invalid Root XPublic Key."

# Initialize Bitcoin mainnet HDWallet
hdwallet: HDWallet = HDWallet(symbol=BTC)
Expand Down

0 comments on commit d38c77b

Please sign in to comment.