aucoin/tests/helpers.py
Casper V. Kristensen b7053ad014
Publish
2018-07-15 23:30:55 +02:00

22 lines
446 B
Python

from threading import RLock
from cryptography.hazmat.primitives.asymmetric import ec
from aucoin import dsa
from aucoin.block import Block
def mine(block: Block, private_key: ec.EllipticCurvePrivateKey):
while True:
block.signature = dsa.sign(private_key, block.truncated_header)
if block.hash <= block.target:
break
return block
class Core(object):
def __init__(self):
self.lock = RLock()