mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Imports inside tests in test_consensus.py
This commit is contained in:
parent
94df6fc00a
commit
d9bc90e5aa
@ -1,9 +1,8 @@
|
||||
from bigchaindb.consensus import BaseConsensusRules
|
||||
from bigchaindb.common import crypto
|
||||
from bigchaindb.common.util import serialize
|
||||
|
||||
|
||||
def test_verify_vote_passes(b, structurally_valid_vote):
|
||||
from bigchaindb.consensus import BaseConsensusRules
|
||||
from bigchaindb.common import crypto
|
||||
from bigchaindb.common.util import serialize
|
||||
vote_body = structurally_valid_vote['vote']
|
||||
vote_data = serialize(vote_body)
|
||||
signature = crypto.PrivateKey(b.me_private).sign(vote_data.encode())
|
||||
@ -16,6 +15,7 @@ def test_verify_vote_passes(b, structurally_valid_vote):
|
||||
|
||||
|
||||
def test_verify_vote_fails_signature(b, structurally_valid_vote):
|
||||
from bigchaindb.consensus import BaseConsensusRules
|
||||
vote_body = structurally_valid_vote['vote']
|
||||
vote_signed = {
|
||||
'node_pubkey': b.me,
|
||||
@ -26,6 +26,9 @@ def test_verify_vote_fails_signature(b, structurally_valid_vote):
|
||||
|
||||
|
||||
def test_verify_vote_fails_schema(b):
|
||||
from bigchaindb.consensus import BaseConsensusRules
|
||||
from bigchaindb.common import crypto
|
||||
from bigchaindb.common.util import serialize
|
||||
vote_body = {}
|
||||
vote_data = serialize(vote_body)
|
||||
signature = crypto.PrivateKey(b.me_private).sign(vote_data.encode())
|
||||
|
Loading…
x
Reference in New Issue
Block a user