Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix buggy testing process of test_from_xpublic_key #56

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
035c717
Merge pull request #13 from coin-tracker/update-readme
meherett May 27, 2021
a2910a8
Merge remote-tracking branch 'origin/master'
meherett Jun 11, 2021
3869c07
Update: Testing doc and added development doc.
meherett Jun 11, 2021
e630169
Add: Root xpublic key derivation cleaner.
meherett Jun 18, 2021
98b15fd
Bump: HDWallet from v1.3.0 to v1.3.1 package.
meherett Jun 18, 2021
749bf8c
Fix: Incorrect output of Base58 decoding.
martinholy Jun 22, 2021
07ace7e
Merge pull request #18 from martinholy/base58_decode_fix
meherett Jun 22, 2021
fcb16c7
add ZECTEST
saloppe73 Jul 22, 2021
697e9e7
update README
saloppe73 Jul 22, 2021
b876ad4
fix LTC/LTCTEST
saloppe73 Jul 22, 2021
aeda29b
Merge pull request #19 from saloppe73/master
meherett Jul 24, 2021
a480596
Update README.md
meherett Jul 26, 2021
e79db28
Fixed BIP141 link
sokripon Aug 12, 2021
d75afc9
Merge pull request #23 from sokripon/patch-1
meherett Aug 12, 2021
78517c5
Fixed link for BIP84
sokripon Aug 12, 2021
8da78de
Fixed link for BIP141
sokripon Aug 12, 2021
8a4924a
Merge pull request #24 from sokripon/patch-1
meherett Aug 12, 2021
71620d2
Bump: HDWallet from v1.3.1 to v1.3.2 package.
meherett Sep 2, 2021
0fa4a52
Fix: Zcash symbol ticker and added symbols tester.
meherett Sep 2, 2021
d7488ef
Bump: HDWallet from v1.3.1 to v1.3.2 package.
meherett Sep 2, 2021
500d840
Change: Coveralls runner python package version to 3.8
meherett Sep 2, 2021
3b76caf
Change: Coveralls runner python form v3.8 to v3.9 package.
meherett Sep 2, 2021
41b6a01
Added version info
bombs-kim Sep 13, 2021
cd8c4f5
Merge pull request #26 from bombs-kim/master
meherett Sep 13, 2021
eb1c806
Upgrade: Now, from root xprivate and xpublic kes merged into from xpr…
meherett Oct 9, 2021
abd7210
Update: Removed root key testers and add more tests on from xprv and …
meherett Oct 9, 2021
cdf5d89
Update: from_xprivate_key and from_xpublic_key examples.
meherett Oct 9, 2021
766a75c
Add: CLI for hdwallet generator and for millions of addresses generator.
meherett Oct 10, 2021
25ea8e7
Drop: Removed first index of space from rows.
meherett Oct 10, 2021
4fe9862
Fix: Hardened key for XPublic key on COIN_TYPE keys.
meherett Oct 10, 2021
253c929
Update: Docs on xprivate and xpublic keys.
meherett Oct 14, 2021
8540759
Fix: is_entropy function, added try except.
meherett Oct 15, 2021
c2eef7f
Add: List command for cryptocurrency, languages and strengths.
meherett Oct 16, 2021
39ff4dc
Add: Command line interface tester components.
meherett Oct 17, 2021
418eb73
Update: Command line interface off generate, hdwallet & addresses.
meherett Oct 17, 2021
7214399
Fix: Derivation class from_index function PATH value.
meherett Oct 17, 2021
89fc212
Fix & Update: All tester components of HDWallet with CLI commands.
meherett Oct 17, 2021
8011cde
Add: hdwallet.gif file for cli example.
meherett Oct 19, 2021
1b8dbe9
Drop: change_to_root parm from from-xprivate_key and from_xpublic_key…
meherett Oct 19, 2021
8eba5bd
Add: click, click-aliases and tabulate packages.
meherett Oct 19, 2021
8072528
Update: cryptocurrencies.rst and added CLI documentation.
meherett Oct 19, 2021
f54091a
Bump: HDWallet from v1.3.2 to v2.0.0 package.
meherett Oct 19, 2021
04d1287
Bump: HDWallet from v1.3.2 to v2.0.0 package.
meherett Oct 19, 2021
c682fc3
Add: get_semantic function for cryptocurrencies.
meherett Oct 23, 2021
3700f1f
Add: Auto semantic selection for is_root_keys functions.
meherett Oct 23, 2021
79ee9db
Add: Required parameter on symbol command.
meherett Oct 24, 2021
27b22de
Drop: Required parameter from symbol command.
meherett Oct 24, 2021
6bb6427
Fix: Semantic auto-selection for xprivate and xpublic keys.
meherett Oct 24, 2021
3993880
Update: All private and public tester components.
meherett Oct 24, 2021
d38c77b
Fix: Semantics and update HDWallet example components.
meherett Oct 24, 2021
1ecf26c
Bump: HDWallet from v2.0.0 to v2.0.1 package.
meherett Oct 24, 2021
2fdf74b
add tron
alimohammad1995 Dec 7, 2021
eb49d2d
Merge pull request #39 from alimohammad1995/tron
meherett Dec 7, 2021
2449c3b
Add: Tron mainnet cryptocurrency by @alimohammad1995 user.
meherett Dec 24, 2021
0725492
Fix: Default path class bug of from_xpublic_key function.
meherett Dec 25, 2021
1c1a3ca
Include: The new Python version 3.10 package.
meherett Dec 25, 2021
0644caf
Change: The docs theme from sphinx_rtd_theme to furo template.
meherett Dec 25, 2021
e0ec7e7
Update: All HDWallet example components.
meherett Dec 25, 2021
814e3b7
Bump: Python-HDWallet from v2.0.1 to v2.1.0 package.
meherett Dec 25, 2021
dd0e606
Fix: Python version 3.10 and setup.py furo package.
meherett Dec 25, 2021
f5a3fe3
Drop: Python version 3.10 package.
meherett Dec 25, 2021
2439a29
Modify: Derivation BIP's initializers tester component.
meherett Dec 25, 2021
56f7642
Update: Installation documentation for CLI.
meherett Feb 19, 2022
d3b2da3
Add: Extras CLI requirements and bump docs packages.
meherett Feb 19, 2022
206aba9
Add: Python version 3.10 package for testing.
meherett Feb 19, 2022
2a0f710
Bump: Python-HDWallet from v2.1.0 to v2.1.1 package.
meherett Feb 19, 2022
05cb2c1
Fix: pythonpackage.yml of pip installation for CLI.
meherett Feb 19, 2022
7686b85
Modify: Python packages and removed some bugs.
meherett Feb 19, 2022
84bf856
Change: Dist from xenial to bionic package.
meherett Feb 19, 2022
09a7b5d
Fix: missing quote in language error
XmasApple Mar 2, 2022
944b07c
Merge pull request #52 from XmasApple/master
meherett Mar 2, 2022
1f671d2
Fix buggy testing process
chenluyong May 9, 2022
a8331e4
More accurate reading of `xpublic_key`
chenluyong May 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@master
Expand All @@ -25,6 +25,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
pip install -e .[cli,tests,docs]
- name: Test with pytest
run: pytest
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
language: python
dist: xenial
sudo: true
dist: bionic
before_install:
- python -m pip install --upgrade pip
install:
- sudo add-apt-repository -y ppa:deadsnakes/ppa
- sudo apt-get update
- sudo apt-get install -y python$TRAVIS_PYTHON_VERSION-dev
- pip install -e .[tests,docs] tox-travis coveralls
- pip install -e .[cli,tests,docs] tox-travis coveralls
matrix:
include:
- name: "3.6"
Expand All @@ -16,5 +14,7 @@ matrix:
python: 3.8
- name: "3.9"
python: 3.9
script: pytest
after_success: if [ "${TRAVIS_PYTHON_VERSION}" == "3.9" ]; then coveralls; fi;
- name: "3.10"
python: 3.10
script: tox
after_success: if [ "${TRAVIS_PYTHON_VERSION}" == "3.10" ]; then coveralls; fi;
79 changes: 50 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

# Hierarchical Deterministic Wallet

[![Build Status](https://travis-ci.org/meherett/python-hdwallet.svg?branch=master)](https://travis-ci.org/meherett/python-hdwallet?branch=master)
[![Build Status](https://app.travis-ci.com/meherett/python-hdwallet.svg?branch=master)](https://app.travis-ci.com/meherett/python-hdwallet)
[![PyPI Version](https://img.shields.io/pypi/v/hdwallet.svg?color=blue)](https://pypi.org/project/hdwallet)
[![Documentation Status](https://readthedocs.org/projects/hdwallet/badge/?version=master)](https://hdwallet.readthedocs.io/en/master/?badge=master)
[![Documentation Status](https://readthedocs.org/projects/hdwallet/badge/?version=master)](https://hdwallet.readthedocs.io)
[![PyPI License](https://img.shields.io/pypi/l/hdwallet?color=black)](https://pypi.org/project/hdwallet)
[![PyPI Python Version](https://img.shields.io/pypi/pyversions/hdwallet.svg)](https://pypi.org/project/hdwallet)
[![Coverage Status](https://coveralls.io/repos/github/meherett/python-hdwallet/badge.svg?branch=master)](https://coveralls.io/github/meherett/python-hdwallet?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/meherett/python-hdwallet/badge.svg?branch=master)](https://coveralls.io/github/meherett/python-hdwallet)

Python-based library for the implementation of a hierarchical deterministic wallet generator for more than 140+ multiple cryptocurrencies.
It allows the handling of multiple coins, multiple accounts, external and internal chains per account and millions of addresses per the chain.
It allows the handling of multiple coins, multiple accounts, external and internal chains per account and millions of addresses per chain.

<img src="https://github.com/meherett/python-hdwallet/blob/master/docs/static/gif/hdwallet.gif"/>

For more info see the BIP specs.

Expand All @@ -19,17 +21,23 @@ For more info see the BIP specs.
| [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) | Hierarchical Deterministic Wallets |
| [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) | Multi-Account Hierarchy for Deterministic Wallets |
| [BIP49](https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki) | Derivation scheme for P2WPKH-nested-in-P2SH based accounts |
| [BIP84](https://github.com/bitcoin/bips/blob/master/bip-0048.mediawiki) | Derivation scheme for P2WPKH based accounts |
| [BIP141](https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki) | Segregated Witness (Consensus layer) |
| [BIP84](https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki) | Derivation scheme for P2WPKH based accounts |
| [BIP141](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki) | Segregated Witness (Consensus layer) |

## Installation

PIP to install `hdwallet` globally, for Linux `sudo` may be required:
The easiest way to install `hdwallet` is via pip:

```
pip install hdwallet
```

To install `hdwallet` command line interface globally, for Linux `sudo` may be required:

```
pip install hdwallet[cli]
```

If you want to run the latest version of the code, you can install from the git:

```
Expand All @@ -40,14 +48,14 @@ For the versions available, see the [tags on this repository](https://github.com

## Quick Usage

Simple Bitcoin mainnet hierarchical deterministic wallet generator:
Simple Bitcoin mainnet HDWallet generator:

```python
#!/usr/bin/env python3

from hdwallet import HDWallet
from hdwallet.utils import generate_entropy
from hdwallet.symbols import BTC
from hdwallet.symbols import BTC as SYMBOL
from typing import Optional

import json
Expand All @@ -62,7 +70,7 @@ ENTROPY: str = generate_entropy(strength=STRENGTH)
PASSPHRASE: Optional[str] = None # "meherett"

# Initialize Bitcoin mainnet HDWallet
hdwallet: HDWallet = HDWallet(symbol=BTC)
hdwallet: HDWallet = HDWallet(symbol=SYMBOL, use_default_path=False)
# Get Bitcoin HDWallet from entropy
hdwallet.from_entropy(
entropy=ENTROPY, language=LANGUAGE, passphrase=PASSPHRASE
Expand Down Expand Up @@ -168,7 +176,7 @@ for address_index in range(10):

```shell script
Mnemonic: bright demand olive glance crater key head glory quantum leisure intact age
Base HD Path: m/44'/60'/0'/0/{address_index}
Base HD Path: m/44'/60'/0'/0/{address_index}

(0) m/44'/60'/0'/0/0 0x3a149f0c5dc5c0F1E29e573215C23710dE9c4f87 0xa45f9af43912fdd5e88c492226be082029f257681d4b3e73b68be535d2fb0526
(1) m/44'/60'/0'/0/1 0x9e8A4fD9bA74DbB0c7F465EF56b47489793AA102 0x6e5ab2a3ae20c7b3a1c0645b03689e88e8cdff16f6a39d6a420bfebc20e8a941
Expand All @@ -185,18 +193,37 @@ Base HD Path: m/44'/60'/0'/0/{address_index}

[Click this to see more examples :)](https://github.com/meherett/python-hdwallet/blob/master/examples)

## Development

To get started, just fork this repo, clone it locally, and run:

```
pip install -e .[cli,tests,docs] -r requirements.txt
```

## Testing

You can run the tests with:

```
pytest
```

Or use `tox` to run the complete suite against the full set of build targets, or pytest to run specific
tests against a specific version of Python.

## Contributing

Feel free to open an [issue](https://github.com/meherett/hdwallet/issues) if you find a problem,
or a pull request if you've solved an issue. And also any help in testing, development,
documentation and other tasks is highly appreciated and useful to the project.
Feel free to open an [issue](https://github.com/meherett/hdwallet/issues) if you find a problem,
or a pull request if you've solved an issue. And also any help in testing, development,
documentation and other tasks is highly appreciated and useful to the project.
There are tasks for contributors of all experience levels.

For more information, see the [CONTRIBUTING.md](https://github.com/meherett/hdwallet/blob/master/CONTRIBUTING.md) file.

## Available Cryptocurrencies

This library simplifies the process of creating a new HDWallet's for:
This library simplifies the process of creating a new hierarchical deterministic wallets for:

| Cryptocurrencies | Symbols | Mainnet | Testnet | Segwit | Coin Type | Default Paths |
| :---------------------------------------------------------------- | :------------------: | :-----: | :-----: | :----: | :-------: | :------------------: |
Expand Down Expand Up @@ -323,6 +350,7 @@ This library simplifies the process of creating a new HDWallet's for:
| Syscoin | `SYS` | Yes | No | Yes | 57 | `m/44'/57'/0'/0/0` |
| TOA Coin | `TOA` | Yes | No | No | 159 | `m/44'/159'/0'/0/0` |
| Thought AI | `THT` | Yes | No | No | 502 | `m/44'/502'/0'/0/0` |
| [Tron](https://github.com/tronprotocol/java-tron) | `TRX` | Yes | No | No | 195 | `m/44'/195'/0'/0/0` |
| Twins | `TWINS`, `TWINSTEST` | Yes | Yes | No | 970 | `m/44'/970'/0'/0/0` |
| Ultimate Secure Cash | `USC` | Yes | No | No | 112 | `m/44'/112'/0'/0/0` |
| Unobtanium | `UNO` | Yes | No | No | 92 | `m/44'/92'/0'/0/0` |
Expand All @@ -337,24 +365,17 @@ This library simplifies the process of creating a new HDWallet's for:
| XUEZ | `XUEZ` | Yes | No | No | 225 | `m/44'/225'/0'/0/0` |
| [XinFin](https://github.com/XinFinOrg/XDPoSChain) | `XDC` | Yes | No | Yes | 550 | `m/44'/550'/0'/0/0` |
| ZClassic | `ZCL` | Yes | No | No | 147 | `m/44'/147'/0'/0/0` |
| Zcash | `ZEC` | Yes | No | No | 133 | `m/44'/133'/0'/0/0` |
| [Zcash](https://github.com/zcash/zcash) | `ZEC`, `ZECTEST` | Yes | Yes | No | 133 | `m/44'/133'/0'/0/0` |
| Zencash | `ZEN` | Yes | No | No | 121 | `m/44'/121'/0'/0/0` |

## Donations

If You found this tool helpful consider making a donation:
If You found this tool helpful consider making a donation:

Ethereum (ETH) or Tether (USDT-ERC20) address:

```text
0x342798bbe9731a91e0557fa8ab0bce1eae6d6ae3
```

Bitcoin (BTC) address:

```text
3GGNPvgbSpMHShcaZJGDXQn5wUJyTz7uoC
```
| Coins | Addresses |
| ----------------------------- | :----------------------------------------: |
| Bitcoin `BTC` | 3GGNPvgbSpMHShcaZJGDXQn5wUJyTz7uoC |
| Ethereum `ETH`, Tether `USDT` | 0x342798bbe9731a91e0557fa8ab0bce1eae6d6ae3 |

## License

Expand Down
10 changes: 10 additions & 0 deletions docs/cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
============================
Command Line Interface (CLI)
============================

.. image:: static/gif/hdwallet.gif
:alt: HDWallet CLI

.. click:: hdwallet.cli.__main__:main
:prog: hdwallet
:show-nested:
34 changes: 26 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import sys
import datetime

from hdwallet import (
__version__, __author__
)

sys.path.insert(0, os.path.abspath("../.."))
sys.path.insert(1, os.path.abspath("./extensions"))
Expand All @@ -22,11 +25,11 @@
# -- Project information -----------------------------------------------------

project = "HDWallet"
copyright = f"{datetime.datetime.now().year}, Meheret Tesfaye Batu"
author = "Meheret Tesfaye"
copyright = f"{datetime.datetime.now().year}, {__author__}"
author = __author__

# The full version, including alpha/beta/rc tags
release = "1.3.0"
release = __version__

# The master toctree document.
master_doc = "toctree"
Expand All @@ -37,7 +40,8 @@
# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
# ones.
extensions = [
"sphinx.ext.autodoc"
"sphinx.ext.autodoc",
"sphinx_click.ext"
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -52,15 +56,15 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"
html_theme = "furo"
# Product logo name
# html_logo = "static/png/hdwallet.png"
# Theme options
html_theme_options = {
# "canonical_url": "",
# "analytics_id": "UA-XXXXXXX-1", # Provided by Google in your dashboard
"logo_only": False,
"display_version": True,
# "logo_only": False,
# "display_version": True,
# "prev_next_buttons_location": "bottom",
# "style_external_links": False,
# "vcs_pageview_mode": "",
Expand All @@ -71,12 +75,26 @@
# "navigation_depth": 4,
# "includehidden": True,
# "titles_only": False

# "light_css_variables": {
# "color-brand-primary": "darkblue",
# "color-brand-content": "darkblue",
# "color-admonition-background": "black",
# },
# "dark_css_variables": {
# "color-brand-primary": "green",
# "color-brand-content": "green",
# "color-admonition-background": "white",
# },
# "sidebar_hide_name": True,
# "navigation_with_keys": True,
# "announcement": "<em>Important</em> announcement!",
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["static", "static/css"]
html_static_path = ["static", "static/css", "static/gif"]

# Autodoc member order
autodoc_member_order = "bysource"
Expand Down
23 changes: 16 additions & 7 deletions docs/cryptocurrencies.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
:orphan:

==========================
Available Cryptocurrencies
==========================
================
Cryptocurrencies
================

This library simplifies the process of generating a new HDWallet's for:

.. note::

All Cryptocurrencies testnet networks default paths are set to ``m/44'/1'/0'/0/0`` value.

.. list-table::
:widths: 25 25 25 25 15 25 50
:header-rows: 1
Expand Down Expand Up @@ -878,6 +882,13 @@ This library simplifies the process of generating a new HDWallet's for:
- No
- 502
- m/44'/502'/0'/0/0
* - `Tron <https://github.com/tronprotocol/java-tron>`_
- TRX
- Yes
- No
- No
- 195
- m/44'/195'/0'/0/0
* - Twins
- TWINS, TWINSTEST
- Yes
Expand Down Expand Up @@ -977,9 +988,9 @@ This library simplifies the process of generating a new HDWallet's for:
- 147
- m/44'/147'/0'/0/0
* - Zcash
- ZEC
- ZEC, ZECTEST
- Yes
- Yes
- No
- No
- 133
- m/44'/133'/0'/0/0
Expand All @@ -990,5 +1001,3 @@ This library simplifies the process of generating a new HDWallet's for:
- No
- 121
- m/44'/121'/0'/0/0

**NOTICE:** All Cryptocurrencies testnet networks default paths are set to **`m/44'/1'/0'/0/0`** value.
Loading