diff --git a/bigchaindb/lib.py b/bigchaindb/lib.py index 05ca3e69..5ba72883 100644 --- a/bigchaindb/lib.py +++ b/bigchaindb/lib.py @@ -98,22 +98,6 @@ class BigchainDB(object): return (500, 'Internal error') return (202, '') - # result = response['result'] - # if mode == self.mode_list[2]: - # return self._process_commit_mode_response(result) - # else: - # status_code = result['code'] - # return self._process_status_code(status_code, - # 'Error while processing transaction') - - # def _process_commit_mode_response(self, result): - # check_tx_status_code = result['check_tx']['code'] - # if check_tx_status_code == 0: - # deliver_tx_status_code = result['deliver_tx']['code'] - # return self._process_status_code(deliver_tx_status_code, - # 'Error while commiting the transaction') - # else: - # return (500, 'Error while validating the transaction') def process_status_code(self, status_code, failure_msg): return (202, '') if status_code == 0 else (500, failure_msg) diff --git a/tests/tendermint/test_core.py b/tests/tendermint/test_core.py index 40958aa2..19e92ca8 100644 --- a/tests/tendermint/test_core.py +++ b/tests/tendermint/test_core.py @@ -84,13 +84,6 @@ def test_deliver_tx__valid_create_updates_db(b, init_chain_request): app.commit() assert b.get_transaction(tx.id).id == tx.id - # unspent_outputs = b.get_unspent_outputs() - # unspent_output = next(unspent_outputs) - # expected_unspent_output = next(tx.unspent_outputs)._asdict() - # assert unspent_output == expected_unspent_output - # with pytest.raises(StopIteration): - # next(unspent_outputs) - def test_deliver_tx__double_spend_fails(b, init_chain_request): from bigchaindb import App diff --git a/tests/tendermint/test_lib.py b/tests/tendermint/test_lib.py index 4e8ff6b3..cee5a062 100644 --- a/tests/tendermint/test_lib.py +++ b/tests/tendermint/test_lib.py @@ -195,12 +195,6 @@ def test_store_transaction(mocker, b, signed_create_tx, mocked_store_transaction = mocker.patch( 'bigchaindb.backend.query.store_transactions') b.store_bulk_transactions([signed_create_tx]) - # mongo_client = MongoClient(host=db_context.host, port=db_context.port) - # utxoset = mongo_client[db_context.name]['utxos'] - # assert utxoset.count() == 1 - # utxo = utxoset.find_one() - # assert utxo['transaction_id'] == signed_create_tx.id - # assert utxo['output_index'] == 0 mocked_store_asset.assert_called_once_with( b.connection, @@ -219,10 +213,7 @@ def test_store_transaction(mocker, b, signed_create_tx, mocked_store_metadata.reset_mock() mocked_store_transaction.reset_mock() b.store_bulk_transactions([signed_transfer_tx]) - # assert utxoset.count() == 1 - # utxo = utxoset.find_one() - # assert utxo['transaction_id'] == signed_transfer_tx.id - # assert utxo['output_index'] == 0 + assert not mocked_store_asset.called mocked_store_metadata.asser_called_once_with( b.connection, @@ -245,12 +236,7 @@ def test_store_bulk_transaction(mocker, b, signed_create_tx, mocked_store_transactions = mocker.patch( 'bigchaindb.backend.query.store_transactions') b.store_bulk_transactions((signed_create_tx,)) - # mongo_client = MongoClient(host=db_context.host, port=db_context.port) - # utxoset = mongo_client[db_context.name]['utxos'] - # assert utxoset.count() == 1 - # utxo = utxoset.find_one() - # assert utxo['transaction_id'] == signed_create_tx.id - # assert utxo['output_index'] == 0 + mocked_store_assets.assert_called_once_with( b.connection, [{'id': signed_create_tx.id, 'data': signed_create_tx.asset['data']}], @@ -268,10 +254,7 @@ def test_store_bulk_transaction(mocker, b, signed_create_tx, mocked_store_metadata.reset_mock() mocked_store_transactions.reset_mock() b.store_bulk_transactions((signed_transfer_tx,)) - # assert utxoset.count() == 1 - # utxo = utxoset.find_one() - # assert utxo['transaction_id'] == signed_transfer_tx.id - # assert utxo['output_index'] == 0 + assert not mocked_store_assets.called mocked_store_metadata.asser_called_once_with( b.connection,