diff --git a/bigchaindb/backend/rethinkdb/query.py b/bigchaindb/backend/rethinkdb/query.py index 57563ad3..61f008c2 100644 --- a/bigchaindb/backend/rethinkdb/query.py +++ b/bigchaindb/backend/rethinkdb/query.py @@ -253,5 +253,5 @@ def get_old_transactions(connection, node_pubkey): .between([node_pubkey, r.minval], [node_pubkey, r.maxval], index='assignee__transaction_timestamp') - .order_by(index=r.asc('assignee_transaction_timestamp')) + .order_by(index=r.asc('assignee__transaction_timestamp')) ) diff --git a/bigchaindb/pipelines/block.py b/bigchaindb/pipelines/block.py index d7cc2735..0f490ae4 100644 --- a/bigchaindb/pipelines/block.py +++ b/bigchaindb/pipelines/block.py @@ -166,8 +166,8 @@ def start(): """Create, start, and return the block pipeline.""" connection = connect(**bigchaindb.config['database']) changefeed = get_changefeed(connection, 'backlog', - ChangeFeed.INSER | ChangeFeed.UPDATE, - preefed=initial()) + ChangeFeed.INSERT | ChangeFeed.UPDATE, + prefeed=initial()) pipeline = create_pipeline() pipeline.setup(indata=changefeed) pipeline.start() diff --git a/tests/pipelines/test_block_creation.py b/tests/pipelines/test_block_creation.py index 0616365d..a48749fc 100644 --- a/tests/pipelines/test_block_creation.py +++ b/tests/pipelines/test_block_creation.py @@ -95,7 +95,8 @@ def test_duplicate_transaction(b, user_pk): # verify tx is in the backlog assert b.get_transaction(txs[0].id) is not None - # try to validate a transaction that's already in the chain; should not work + # try to validate a transaction that's already in the chain; should not + # work assert block_maker.validate_tx(txs[0].to_dict()) is None # duplicate tx should be removed from backlog @@ -159,9 +160,10 @@ def test_start(create_pipeline): def test_full_pipeline(b, user_pk): import random - from bigchaindb.backend import query + from bigchaindb.backend import query, get_changefeed + from bigchaindb.backend.changefeed import ChangeFeed from bigchaindb.models import Block, Transaction - from bigchaindb.pipelines.block import create_pipeline, get_changefeed + from bigchaindb.pipelines.block import create_pipeline, initial outpipe = Pipe() # include myself here, so that some tx are actually assigned to me @@ -175,8 +177,11 @@ def test_full_pipeline(b, user_pk): assert query.count_backlog(b.connection) == 100 + changefeed = get_changefeed(b.connection, 'backlog', + ChangeFeed.INSERT | ChangeFeed.UPDATE, + prefeed=initial()) pipeline = create_pipeline() - pipeline.setup(indata=get_changefeed(), outdata=outpipe) + pipeline.setup(indata=changefeed, outdata=outpipe) pipeline.start() time.sleep(2)