From 48e38b67131cc4ac3e5cfaa4e1e4bc8acea7405f Mon Sep 17 00:00:00 2001 From: codegeschrei Date: Thu, 16 Nov 2017 17:14:21 +0100 Subject: [PATCH] fix flake8 errors --- bigchaindb/tendermint/core.py | 3 ++- tests/tendermint/test_core.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bigchaindb/tendermint/core.py b/bigchaindb/tendermint/core.py index 2725606d..f33182ef 100644 --- a/bigchaindb/tendermint/core.py +++ b/bigchaindb/tendermint/core.py @@ -89,7 +89,8 @@ class App(BaseApplication): block = self.bigchaindb.get_latest_block() if self.block_txn_ids: - self.block_txn_hash = calculate_hash([block['hash'], block_txn_hash]) + self.block_txn_hash = calculate_hash([block['hash'], + block_txn_hash]) else: self.block_txn_hash = block['hash'] diff --git a/tests/tendermint/test_core.py b/tests/tendermint/test_core.py index c6ee01ff..91aa2514 100644 --- a/tests/tendermint/test_core.py +++ b/tests/tendermint/test_core.py @@ -75,11 +75,11 @@ def test_deliver_tx__double_spend_fails(b): result = app.deliver_tx(encode_tx_to_bytes(tx)) assert result.is_error() + def test_deliver_transfer_tx__double_spend_fails(b): from bigchaindb.tendermint import App from bigchaindb.models import Transaction from bigchaindb.common.crypto import generate_key_pair - from bigchaindb.common.transaction import Input alice = generate_key_pair() bob = generate_key_pair() @@ -91,7 +91,7 @@ def test_deliver_transfer_tx__double_spend_fails(b): tx = Transaction.create([alice.public_key], [([alice.public_key], 1)], - asset = asset)\ + asset=asset)\ .sign([alice.private_key]) app = App(b) @@ -99,18 +99,18 @@ def test_deliver_transfer_tx__double_spend_fails(b): assert result.is_ok() tx_transfer = Transaction.transfer(tx.to_inputs(), - [([bob.public_key], 1)], - asset_id = tx.id)\ - .sign([alice.private_key]) + [([bob.public_key], 1)], + asset_id=tx.id)\ + .sign([alice.private_key]) app = App(b) result = app.deliver_tx(encode_tx_to_bytes(tx_transfer)) assert result.is_ok() double_spend = Transaction.transfer(tx.to_inputs(), - [([carly.public_key], 1)], - asset_id = tx.id)\ - .sign([alice.private_key]) + [([carly.public_key], 1)], + asset_id=tx.id)\ + .sign([alice.private_key]) app = App(b) result = app.deliver_tx(encode_tx_to_bytes(double_spend))