fix fixture

This commit is contained in:
ryan
2016-07-18 11:02:02 +02:00
parent 84945436a3
commit 6fa9d5f563

View File

@@ -98,23 +98,22 @@ def cleanup_tables(request, node_config):
@pytest.fixture
def inputs(user_vk, amount=4, b=None, blocks=4):
def inputs(user_vk):
from bigchaindb.exceptions import GenesisBlockAlreadyExistsError
# 1. create the genesis block
b = b or Bigchain()
b = Bigchain()
try:
b.create_genesis_block()
except GenesisBlockAlreadyExistsError:
pass
# 2. create block with transactions for `USER` to spend
for block in range(blocks):
for block in range(4):
transactions = []
for i in range(amount):
for i in range(10):
tx = b.create_transaction(b.me, user_vk, None, 'CREATE')
tx_signed = b.sign_transaction(tx, b.me_private)
transactions.append(tx_signed)
b.write_transaction(tx_signed)
block = b.create_block(transactions)
b.write_block(block, durability='hard')