Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit dc3812d

Browse files
committed
Replace secp256k1 by secp256k1prp which is better maintained and available on more platforms
1 parent 783e3e0 commit dc3812d

8 files changed

Lines changed: 40 additions & 17 deletions

File tree

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
name: install dependencies
3636
command: |
3737
sudo python -m pip install -r requirements-test.txt
38-
sudo python -m pip install --upgrade secp256k1
38+
sudo python -m pip install --upgrade secp256k1prp
3939
4040
# run tests!
4141
# this example uses Django's built-in test-runner

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ before_install:
5757
- pip install --upgrade pip
5858
- pip install --upgrade wheel
5959
# Set numpy version first, other packages link against it
60-
- pip install six nose coverage codecov tox-travis pytest pytest-cov coveralls codacy-coverage parameterized secp256k1 cryptography scrypt
60+
- pip install six nose coverage codecov tox-travis pytest pytest-cov coveralls codacy-coverage parameterized secp256k1prp cryptography scrypt
6161
- pip install pycryptodomex pyyaml appdirs pylibscrypt
6262
- pip install ecdsa requests future websocket-client pytz six Click events prettytable
6363

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
Changelog
22
=========
3+
0.20.17
4+
-------
5+
* Fix transfer rounding error, which prevent transfering of e.g. 1.013 STEEM.
6+
* get_account_votes works again with api.steemit.com
7+
* Use secp256k1prp as better replacement for secp256k1
8+
39
0.20.16
410
-------
511
* Fix beempy walletinfo and sign

README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ Signing and Verify can be fasten (200 %) by installing cryptography:
107107
108108
pip install -U cryptography
109109
110+
or:
111+
112+
.. code:: bash
113+
114+
pip install -U secp256k1prp
115+
110116
Install or update beem by pip::
111117

112118
pip install -U beem

beemgraphenebase/ecdsasig.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,21 @@
2222
GMPY2_MODULE = False
2323
if not SECP256K1_MODULE:
2424
try:
25-
import secp256k1
25+
import secp256k1prp as secp256k1
2626
SECP256K1_MODULE = "secp256k1"
2727
SECP256K1_AVAILABLE = True
28-
except ImportError:
28+
except:
2929
try:
30-
import cryptography
31-
SECP256K1_MODULE = "cryptography"
32-
CRYPTOGRAPHY_AVAILABLE = True
30+
import secp256k1
31+
SECP256K1_MODULE = "secp256k1"
32+
SECP256K1_AVAILABLE = True
3333
except ImportError:
34-
SECP256K1_MODULE = "ecdsa"
34+
try:
35+
import cryptography
36+
SECP256K1_MODULE = "cryptography"
37+
CRYPTOGRAPHY_AVAILABLE = True
38+
except ImportError:
39+
SECP256K1_MODULE = "ecdsa"
3540

3641
try:
3742
from cryptography.hazmat.backends import default_backend

beemgraphenebase/signedtransactions.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,19 @@
2626
log = logging.getLogger(__name__)
2727

2828
try:
29-
import secp256k1
29+
import secp256k1prp as secp256k1
3030
USE_SECP256K1 = True
31-
log.debug("Loaded secp256k1 binding.")
32-
except Exception:
33-
USE_SECP256K1 = False
34-
log.debug("To speed up transactions signing install \n"
35-
" pip install secp256k1")
31+
log.debug("Loaded secp256k1prp binding.")
32+
except:
33+
try:
34+
import secp256k1
35+
USE_SECP256K1 = True
36+
log.debug("Loaded secp256k1 binding.")
37+
except Exception:
38+
USE_SECP256K1 = False
39+
log.debug("To speed up transactions signing install \n"
40+
" pip install secp256k1\n"
41+
"or pip install secp256k1prp")
3642

3743

3844
class Signed_Transaction(GrapheneObject):

requirements-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pycryptodomex==3.7.2
1010
scrypt==0.8.6
1111
Events==0.3
1212
cryptography==2.4.2
13-
pyyaml==3.13
13+
pyyaml>=4.2b1
1414
mock==2.0.0
1515
appdirs==1.4.3
1616
Click==7.0

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ deps =
2222
secp256k1
2323
scrypt
2424
commands =
25-
coverage run --parallel-mode -m pytest tests/beem tests/beemapi tests/beembase tests/beemgraphene {posargs}
25+
coverage run --parallel-mode -m pytest {posargs}
2626
coverage combine
2727
coverage report -m
2828
coverage xml
@@ -47,7 +47,7 @@ deps =
4747
secp256k1
4848
scrypt
4949
commands =
50-
coverage run --parallel-mode -m pytest tests/beem tests/beemapi tests/beembase tests/beemgraphene {posargs}
50+
coverage run --parallel-mode -m pytest {posargs}
5151
coverage combine
5252
coverage report -m
5353
coverage xml

0 commit comments

Comments
 (0)