Skip to content

Problem: Block parameters are not required anymore#2374

Merged
kansi merged 32 commits intobigchaindb:masterfrom
codegeschrei:remove-block-parameter
Aug 8, 2018
Merged

Problem: Block parameters are not required anymore#2374
kansi merged 32 commits intobigchaindb:masterfrom
codegeschrei:remove-block-parameter

Conversation

@codegeschrei
Copy link
Copy Markdown
Contributor

@codegeschrei codegeschrei commented Jul 3, 2018

Solution: remove Block parameters

remove parameters mentioned here
depending on PR #2366
(when #2366 is merged I'll update this PR so that it can be merged)

codegeschrei and others added 22 commits June 28, 2018 09:35
Solution: add wget to the requirements for docs
Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.
Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.
…its, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!
…its, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!
Solution: resolved merge conflicts to excavate Block class from my branch
Solution: Merged and repushed
Solution: Merge changes into Master
Solution: remove Block parameters
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 3, 2018

Codecov Report

Merging #2374 into master will decrease coverage by 0.06%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2374      +/-   ##
==========================================
- Coverage   88.22%   88.16%   -0.07%     
==========================================
  Files          40       40              
  Lines        2310     2298      -12     
==========================================
- Hits         2038     2026      -12     
  Misses        272      272

TX_IN_BACKLOG = 'backlog'
"""return if transaction is in backlog"""
TX_UNDECIDED = 'undecided'
"""return if tx is in undecided block"""
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.

These are not needed anymore.

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.

ah, so the only one that stays is the TX_VALID?

Copy link
Copy Markdown
Contributor

@kansi kansi Jul 11, 2018

Choose a reason for hiding this comment

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

both TX_UNDECIDED and TX_VALID are not needed anymore.

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.

ok, will remove it.

@ttmc
Copy link
Copy Markdown
Contributor

ttmc commented Jul 11, 2018

Did you do a search to find all instances of BLOCK_INVALID (and friends) in the codebase?

@codegeschrei
Copy link
Copy Markdown
Contributor Author

@ttmc yes, for the ones that are currently removed. If you find occurrences of BLOCK_INVALID or BLOCK_VALID they should be event types.

Solution: remove transaction parameter
@kansi
Copy link
Copy Markdown
Contributor

kansi commented Jul 16, 2018

I think we can get rid of status? Since transactions can only be 'valid' there seems to be no reason to explicitly return 'valid'. /cc @vrde

@vrde
Copy link
Copy Markdown
Contributor

vrde commented Jul 16, 2018

I think we can get rid of status? Since transactions can only be 'valid' there seems to be no reason to explicitly return 'valid'. /cc @vrde

👍


if include_status:
return transaction, self.TX_VALID if transaction else None
return transaction, 'valid' if transaction else None
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 the 'valid' should go away here 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.

Then I need to change the whole function and remove include_status too. I can do it if we want that.

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 include_status is only used in the above if condition?

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.

yes, it's only in the if.

for txid in txids:
tx, status = self.get_transaction(txid, True)
if status == self.TX_VALID:
yield tx
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 original code seems to return tx class but the new code returns dict ?

Solution: return tx class instead of dict
@kansi kansi merged commit 44be8f5 into bigchaindb:master Aug 8, 2018
@kansi kansi mentioned this pull request Aug 8, 2018
16 tasks
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