Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit dd5016b

Browse files
authored
Merge pull request #30 from mbroedel/main
Update secp256k1.py for secp256k1-py 0.14.0
2 parents dcfbeba + f9c103b commit dd5016b

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

sawtooth_signing/secp256k1.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
from sawtooth_signing.core import PublicKey
2626
from sawtooth_signing.core import Context
2727

28-
__CONTEXTBASE__ = secp256k1.Base(ctx=None, flags=secp256k1.ALL_FLAGS)
29-
__CTX__ = __CONTEXTBASE__.ctx
30-
3128

3229
class Secp256k1PrivateKey(PrivateKey):
3330
def __init__(self, secp256k1_private_key):
@@ -48,7 +45,7 @@ def secp256k1_private_key(self):
4845

4946
@staticmethod
5047
def from_bytes(byte_str):
51-
return Secp256k1PrivateKey(secp256k1.PrivateKey(byte_str, ctx=__CTX__))
48+
return Secp256k1PrivateKey(secp256k1.PrivateKey(byte_str))
5249

5350
@staticmethod
5451
def from_hex(hex_str):
@@ -60,7 +57,7 @@ def from_hex(hex_str):
6057

6158
@staticmethod
6259
def new_random():
63-
return Secp256k1PrivateKey(secp256k1.PrivateKey(ctx=__CTX__))
60+
return Secp256k1PrivateKey(secp256k1.PrivateKey())
6461

6562

6663
class Secp256k1PublicKey(PublicKey):
@@ -84,7 +81,7 @@ def as_bytes(self):
8481

8582
@staticmethod
8683
def from_bytes(byte_str):
87-
public_key = secp256k1.PublicKey(byte_str, raw=True, ctx=__CTX__)
84+
public_key = secp256k1.PublicKey(byte_str, raw=True)
8885
return Secp256k1PublicKey(public_key)
8986

9087
@staticmethod
@@ -97,9 +94,6 @@ def from_hex(hex_str):
9794

9895

9996
class Secp256k1Context(Context):
100-
def __init__(self):
101-
self._ctx = __CTX__
102-
10397
def get_algorithm_name(self):
10498
return "secp256k1"
10599

0 commit comments

Comments
 (0)