diff --git a/tests/test_consensus.py b/tests/test_consensus.py index 43c4ef3e..c5d7f7c1 100644 --- a/tests/test_consensus.py +++ b/tests/test_consensus.py @@ -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())