fix flake8 errors

This commit is contained in:
codegeschrei 2017-11-16 17:14:21 +01:00
parent 63f0baf1b7
commit 48e38b6713
2 changed files with 10 additions and 9 deletions

View File

@ -89,7 +89,8 @@ class App(BaseApplication):
block = self.bigchaindb.get_latest_block() block = self.bigchaindb.get_latest_block()
if self.block_txn_ids: 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: else:
self.block_txn_hash = block['hash'] self.block_txn_hash = block['hash']

View File

@ -75,11 +75,11 @@ def test_deliver_tx__double_spend_fails(b):
result = app.deliver_tx(encode_tx_to_bytes(tx)) result = app.deliver_tx(encode_tx_to_bytes(tx))
assert result.is_error() assert result.is_error()
def test_deliver_transfer_tx__double_spend_fails(b): def test_deliver_transfer_tx__double_spend_fails(b):
from bigchaindb.tendermint import App from bigchaindb.tendermint import App
from bigchaindb.models import Transaction from bigchaindb.models import Transaction
from bigchaindb.common.crypto import generate_key_pair from bigchaindb.common.crypto import generate_key_pair
from bigchaindb.common.transaction import Input
alice = generate_key_pair() alice = generate_key_pair()
bob = 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], tx = Transaction.create([alice.public_key],
[([alice.public_key], 1)], [([alice.public_key], 1)],
asset = asset)\ asset=asset)\
.sign([alice.private_key]) .sign([alice.private_key])
app = App(b) app = App(b)
@ -99,18 +99,18 @@ def test_deliver_transfer_tx__double_spend_fails(b):
assert result.is_ok() assert result.is_ok()
tx_transfer = Transaction.transfer(tx.to_inputs(), tx_transfer = Transaction.transfer(tx.to_inputs(),
[([bob.public_key], 1)], [([bob.public_key], 1)],
asset_id = tx.id)\ asset_id=tx.id)\
.sign([alice.private_key]) .sign([alice.private_key])
app = App(b) app = App(b)
result = app.deliver_tx(encode_tx_to_bytes(tx_transfer)) result = app.deliver_tx(encode_tx_to_bytes(tx_transfer))
assert result.is_ok() assert result.is_ok()
double_spend = Transaction.transfer(tx.to_inputs(), double_spend = Transaction.transfer(tx.to_inputs(),
[([carly.public_key], 1)], [([carly.public_key], 1)],
asset_id = tx.id)\ asset_id=tx.id)\
.sign([alice.private_key]) .sign([alice.private_key])
app = App(b) app = App(b)
result = app.deliver_tx(encode_tx_to_bytes(double_spend)) result = app.deliver_tx(encode_tx_to_bytes(double_spend))