Skip to content

Problem: Bigchain class is unused and redundant#2366

Merged
ttmc merged 17 commits intobigchaindb:masterfrom
z-bowen:remove_bigchain_class
Jul 10, 2018
Merged

Problem: Bigchain class is unused and redundant#2366
ttmc merged 17 commits intobigchaindb:masterfrom
z-bowen:remove_bigchain_class

Conversation

@z-bowen
Copy link
Copy Markdown
Contributor

@z-bowen z-bowen commented Jun 28, 2018

Solution

Remove Bigchain class and BigchainDB's dependency on it.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 29, 2018

Codecov Report

Merging #2366 into master will decrease coverage by 0.09%.
The diff coverage is 82.92%.

@@            Coverage Diff            @@
##           master    #2366     +/-   ##
=========================================
- Coverage   86.96%   86.87%   -0.1%     
=========================================
  Files          38       38             
  Lines        2132     2163     +31     
=========================================
+ Hits         1854     1879     +25     
- Misses        278      284      +6

@z-bowen z-bowen requested a review from codegeschrei June 29, 2018 10:16
bigchain (:class:`~bigchaindb.Bigchain`): An instantiated Bigchain
object.
bigchain (:class:`~bigchaindb.tendermint.BigchainDB`): An
instantiated BigchainDB object.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole class is going to be removed in #2368


from bigchaindb import backend
from bigchaindb import Bigchain
import bigchaindb
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this import?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was like that in the old Bigchain class, and it causes my local unit tests to fail if I change it. I agree that it's ugly, and we should fix it, but I think it's outside the scope of this PR.

def test_get_owned_ids_calls_get_outputs_filtered():
from bigchaindb.core import Bigchain
from bigchaindb.tendermint import BigchainDB
with patch('bigchaindb.core.Bigchain.get_outputs_filtered') as gof:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be changed too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Good thing this test is deactivated! lol

@codegeschrei
Copy link
Copy Markdown
Contributor

For codecov I wouldn't mind merging it with a decrease of .3
We need to check the coverage later anyways

BLOCK_UNDECIDED = TX_UNDECIDED = 'undecided'
"""return if block is undecided, or tx is in undecided block"""

TX_IN_BACKLOG = 'backlog'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameters BLOCK_INVALID, BLOCK_VALID, BLOCK_UNDECIDED , TX_IN_BACKLOG are not required anymore and should be removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It breaks a bunch of tests when I remove those parameters. I suggest we excavate them in a separate PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good idea. This PR is already big enough.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm taking care of removing the parameters in a different PR

Solution: resolved merge conflicts to excavate Block class from my branch
@muawiakh
Copy link
Copy Markdown
Contributor

There are some conflicts in this change now, probably because of #2342

z-bowen added 2 commits June 29, 2018 15:53
Solution: Merged and repushed
Solution: Merge changes into Master
@kansi
Copy link
Copy Markdown
Contributor

kansi commented Jun 29, 2018

I think the changes haven't been merged from the master, i.e. please have a look at this vs this

@ttmc ttmc merged commit 4d2e584 into bigchaindb:master Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants