mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
fix fixture
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user