mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
decode signature to a str
This commit is contained in:
parent
8ebd93ed32
commit
a824e275e0
@ -627,7 +627,7 @@ class Bigchain(object):
|
|||||||
|
|
||||||
vote_signed = {
|
vote_signed = {
|
||||||
'node_pubkey': self.me,
|
'node_pubkey': self.me,
|
||||||
'signature': signature,
|
'signature': signature.decode(),
|
||||||
'vote': vote
|
'vote': vote
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ def test_vote_creation_valid(b):
|
|||||||
assert vote['vote']['is_block_valid'] is True
|
assert vote['vote']['is_block_valid'] is True
|
||||||
assert vote['vote']['invalid_reason'] is None
|
assert vote['vote']['invalid_reason'] is None
|
||||||
assert vote['node_pubkey'] == b.me
|
assert vote['node_pubkey'] == b.me
|
||||||
|
assert isinstance(vote['signature'], str)
|
||||||
assert crypto.PublicKey(b.me).verify(serialize(vote['vote']).encode(),
|
assert crypto.PublicKey(b.me).verify(serialize(vote['vote']).encode(),
|
||||||
vote['signature']) is True
|
vote['signature']) is True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user