mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
update to cryptoconditions 0.1.6: removes the need of the cryptography dependency
This commit is contained in:
parent
6da2603e28
commit
a6dd9dc1fd
@ -290,7 +290,7 @@ class Bigchain(object):
|
|||||||
# Calculate the hash of the new block
|
# Calculate the hash of the new block
|
||||||
block_data = util.serialize(block)
|
block_data = util.serialize(block)
|
||||||
block_hash = crypto.hash_data(block_data)
|
block_hash = crypto.hash_data(block_data)
|
||||||
block_signature = crypto.SigningKey(self.me_private).sign(block_data).decode()
|
block_signature = crypto.SigningKey(self.me_private).sign(block_data)
|
||||||
|
|
||||||
block = {
|
block = {
|
||||||
'id': block_hash,
|
'id': block_hash,
|
||||||
@ -409,7 +409,7 @@ class Bigchain(object):
|
|||||||
}
|
}
|
||||||
|
|
||||||
vote_data = util.serialize(vote)
|
vote_data = util.serialize(vote)
|
||||||
signature = crypto.SigningKey(self.me_private).sign(vote_data).decode()
|
signature = crypto.SigningKey(self.me_private).sign(vote_data)
|
||||||
|
|
||||||
vote_signed = {
|
vote_signed = {
|
||||||
'node_pubkey': self.me,
|
'node_pubkey': self.me,
|
||||||
|
@ -13,5 +13,5 @@ def generate_key_pair():
|
|||||||
sk, pk = ed25519.ed25519_generate_key_pair()
|
sk, pk = ed25519.ed25519_generate_key_pair()
|
||||||
return sk.decode(), pk.decode()
|
return sk.decode(), pk.decode()
|
||||||
|
|
||||||
SigningKey = ed25519.Ed25519SigningKey
|
SigningKey = ed25519.SigningKey
|
||||||
VerifyingKey = ed25519.Ed25519VerifyingKey
|
VerifyingKey = ed25519.VerifyingKey
|
||||||
|
@ -219,7 +219,7 @@ def sign_tx(transaction, private_key):
|
|||||||
private_key = crypto.SigningKey(private_key)
|
private_key = crypto.SigningKey(private_key)
|
||||||
signature = private_key.sign(serialize(transaction))
|
signature = private_key.sign(serialize(transaction))
|
||||||
signed_transaction = transaction.copy()
|
signed_transaction = transaction.copy()
|
||||||
signed_transaction.update({'signature': signature.decode()})
|
signed_transaction.update({'signature': signature})
|
||||||
return signed_transaction
|
return signed_transaction
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ After a couple of seconds, we can check if the transactions was included in the
|
|||||||
# retrieve a transaction from the bigchain
|
# retrieve a transaction from the bigchain
|
||||||
tx_retrieved = b.get_transaction(tx_signed['id'])
|
tx_retrieved = b.get_transaction(tx_signed['id'])
|
||||||
|
|
||||||
'id': '6539dded9479c47b3c83385ae569ecaa90bcf387240d1ee2ea3ae0f7986aeddd',
|
{ 'id': '6539dded9479c47b3c83385ae569ecaa90bcf387240d1ee2ea3ae0f7986aeddd',
|
||||||
'transaction': { 'current_owner': 'pvGtcm5dvwWMzCqagki1N6CDKYs2J1cCwTNw8CqJic3Q',
|
'transaction': { 'current_owner': 'pvGtcm5dvwWMzCqagki1N6CDKYs2J1cCwTNw8CqJic3Q',
|
||||||
'data': { 'hash': '872fa6e6f46246cd44afdb2ee9cfae0e72885fb0910e2bcf9a5a2a4eadb417b8',
|
'data': { 'hash': '872fa6e6f46246cd44afdb2ee9cfae0e72885fb0910e2bcf9a5a2a4eadb417b8',
|
||||||
'payload': {'msg': 'Hello BigchainDB!'}},
|
'payload': {'msg': 'Hello BigchainDB!'}},
|
||||||
|
2
setup.py
2
setup.py
@ -76,7 +76,7 @@ setup(
|
|||||||
'rethinkdb==2.2.0.post4',
|
'rethinkdb==2.2.0.post4',
|
||||||
'pysha3==0.3',
|
'pysha3==0.3',
|
||||||
'pytz==2015.7',
|
'pytz==2015.7',
|
||||||
'cryptoconditions==0.1.1',
|
'cryptoconditions==0.1.6',
|
||||||
'statsd==3.2.1',
|
'statsd==3.2.1',
|
||||||
'python-rapidjson==0.0.6',
|
'python-rapidjson==0.0.6',
|
||||||
'logstats==0.2.1',
|
'logstats==0.2.1',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user