Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove block delete reverter #544

Merged
merged 1 commit into from
Aug 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions bigchaindb/block.py

This file was deleted.

5 changes: 0 additions & 5 deletions bigchaindb/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from bigchaindb.pipelines import block, election
from bigchaindb import Bigchain
from bigchaindb.voter import Voter
from bigchaindb.block import BlockDeleteRevert
from bigchaindb.web import server


Expand Down Expand Up @@ -54,23 +53,19 @@ def map_bigchain(self):
def start(self):
logger.info('Initializing BigchainDB...')

delete_reverter = BlockDeleteRevert(self.q_revert_delete)

# start the web api
app_server = server.create_server(bigchaindb.config['server'])
p_webapi = mp.Process(name='webapi', target=app_server.run)
p_webapi.start()

# initialize the processes
p_map_bigchain = mp.Process(name='bigchain_mapper', target=self.map_bigchain)
p_block_delete_revert = mp.Process(name='block_delete_revert', target=delete_reverter.start)
p_voter = Voter(self.q_new_block)
# start the processes
logger.info('starting bigchain mapper')
p_map_bigchain.start()
logger.info('starting block')
block.start()
p_block_delete_revert.start()

logger.info('starting voter')
p_voter.start()
Expand Down
35 changes: 0 additions & 35 deletions tests/db/test_bigchain_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import bigchaindb
from bigchaindb import crypto, exceptions, util
from bigchaindb.voter import Voter
from bigchaindb.block import BlockDeleteRevert


@pytest.mark.skipif(reason='Some tests throw a ResourceWarning that might result in some weird '
Expand Down Expand Up @@ -610,40 +609,6 @@ def test_invalid_node_pubkey(self, b):


class TestBigchainBlock(object):

def test_revert_delete_block(self, b):
b.create_genesis_block()

block_1 = dummy_block()
block_2 = dummy_block()
block_3 = dummy_block()

b.write_block(block_1, durability='hard')
b.write_block(block_2, durability='hard')
b.write_block(block_3, durability='hard')

b.write_vote(block_1, b.vote(block_1['id'], b.get_last_voted_block()['id'], True))
b.write_vote(block_2, b.vote(block_2['id'], b.get_last_voted_block()['id'], True))
b.write_vote(block_3, b.vote(block_3['id'], b.get_last_voted_block()['id'], True))

q_revert_delete = mp.Queue()

reverter = BlockDeleteRevert(q_revert_delete)

# simulate changefeed
r.table('bigchain').get(block_2['id']).delete().run(b.conn)
q_revert_delete.put(block_2)

assert r.table('bigchain').get(block_2['id']).run(b.conn) is None

reverter.start()
time.sleep(1)
reverter.kill()

reverted_block_2 = r.table('bigchain').get(block_2['id']).run(b.conn)

assert reverted_block_2 == block_2

def test_duplicated_transactions(self):
pytest.skip('We may have duplicates in the initial_results and changefeed')

Expand Down