diff --git a/.circleci/config.yml b/.circleci/config.yml index 815de7631ac35484d07501099fe4742f3c27911c..978aa7954930a09ded06176938c39212e421cb22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,7 @@ jobs: name: install dependencies command: | sudo python -m pip install -r requirements-test.txt - sudo python -m pip install --upgrade secp256k1 + sudo python -m pip install --upgrade secp256k1prp # run tests! # this example uses Django's built-in test-runner diff --git a/.travis.yml b/.travis.yml index a36a3e5090b9c8474515753d830a20f133238d1e..f04f18c9d91e67ef5491e12b1f88b9aa264a5603 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,7 @@ before_install: - pip install --upgrade pip - pip install --upgrade wheel # Set numpy version first, other packages link against it - - pip install six nose coverage codecov tox-travis pytest pytest-cov coveralls codacy-coverage parameterized secp256k1 cryptography scrypt + - pip install six nose coverage codecov tox-travis pytest pytest-cov coveralls codacy-coverage parameterized secp256k1prp cryptography scrypt - pip install pycryptodomex pyyaml appdirs pylibscrypt - pip install ecdsa requests future websocket-client pytz six Click events prettytable diff --git a/CHANGELOG.rst b/CHANGELOG.rst index aafcb2e0c1231d44e5b7535b334b160c2a099142..47871ec36f6cd91f012de53f6ab1aacbedd7fc80 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,11 @@ Changelog ========= +0.20.17 +------- +* Fix transfer rounding error, which prevent transfering of e.g. 1.013 STEEM. +* get_account_votes works again with api.steemit.com +* Use secp256k1prp as better replacement for secp256k1 + 0.20.16 ------- * Fix beempy walletinfo and sign diff --git a/README.rst b/README.rst index 05eb93b5b7d94dc0cf860bc837086cd7f3d52081..c26525a2a1251afe81de873d142e4906452de9d9 100644 --- a/README.rst +++ b/README.rst @@ -107,6 +107,12 @@ Signing and Verify can be fasten (200 %) by installing cryptography: pip install -U cryptography +or: + +.. code:: bash + + pip install -U secp256k1prp + Install or update beem by pip:: pip install -U beem diff --git a/beemgraphenebase/ecdsasig.py b/beemgraphenebase/ecdsasig.py index 151dcc9b425efb189a6f15aff51bf3330d93bea4..1e849f4e439420ac8a1e1806a122fd2b14d27d5b 100644 --- a/beemgraphenebase/ecdsasig.py +++ b/beemgraphenebase/ecdsasig.py @@ -22,16 +22,21 @@ CRYPTOGRAPHY_AVAILABLE = False GMPY2_MODULE = False if not SECP256K1_MODULE: try: - import secp256k1 + import secp256k1prp as secp256k1 SECP256K1_MODULE = "secp256k1" SECP256K1_AVAILABLE = True - except ImportError: + except: try: - import cryptography - SECP256K1_MODULE = "cryptography" - CRYPTOGRAPHY_AVAILABLE = True + import secp256k1 + SECP256K1_MODULE = "secp256k1" + SECP256K1_AVAILABLE = True except ImportError: - SECP256K1_MODULE = "ecdsa" + try: + import cryptography + SECP256K1_MODULE = "cryptography" + CRYPTOGRAPHY_AVAILABLE = True + except ImportError: + SECP256K1_MODULE = "ecdsa" try: from cryptography.hazmat.backends import default_backend diff --git a/beemgraphenebase/signedtransactions.py b/beemgraphenebase/signedtransactions.py index cfec71d4f888f03742aabbf5577f8e40569d6954..5e91fa0505ddf0ed222ec5be110b0e4b9d841a54 100644 --- a/beemgraphenebase/signedtransactions.py +++ b/beemgraphenebase/signedtransactions.py @@ -26,13 +26,19 @@ import logging log = logging.getLogger(__name__) try: - import secp256k1 + import secp256k1prp as secp256k1 USE_SECP256K1 = True - log.debug("Loaded secp256k1 binding.") -except Exception: - USE_SECP256K1 = False - log.debug("To speed up transactions signing install \n" - " pip install secp256k1") + log.debug("Loaded secp256k1prp binding.") +except: + try: + import secp256k1 + USE_SECP256K1 = True + log.debug("Loaded secp256k1 binding.") + except Exception: + USE_SECP256K1 = False + log.debug("To speed up transactions signing install \n" + " pip install secp256k1\n" + "or pip install secp256k1prp") class Signed_Transaction(GrapheneObject): diff --git a/requirements-test.txt b/requirements-test.txt index 5b2508351a1fdb51fa0e742b635163c507b52a5b..8fa8ef96dcccf1b3c4c2c5b90e17cb784ef1106d 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -10,7 +10,7 @@ pycryptodomex==3.7.2 scrypt==0.8.6 Events==0.3 cryptography==2.4.2 -pyyaml==3.13 +pyyaml>=4.2b1 mock==2.0.0 appdirs==1.4.3 Click==7.0 diff --git a/tox.ini b/tox.ini index 3baf4e428becf100eaee1240709a72d59beb9997..5e8d759dd263a063800d858d1e81fc629b606692 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,7 @@ deps = secp256k1 scrypt commands = - coverage run --parallel-mode -m pytest tests/beem tests/beemapi tests/beembase tests/beemgraphene {posargs} + coverage run --parallel-mode -m pytest {posargs} coverage combine coverage report -m coverage xml @@ -47,7 +47,7 @@ deps = secp256k1 scrypt commands = - coverage run --parallel-mode -m pytest tests/beem tests/beemapi tests/beembase tests/beemgraphene {posargs} + coverage run --parallel-mode -m pytest {posargs} coverage combine coverage report -m coverage xml