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
Ignore invalid blocks #324
Conversation
break | ||
|
||
# Query the transaction in the target block and return | ||
response = r.table('bigchain').filter(lambda block: block['id'] == target_block_id).nth(0)\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use just get
? The id
is the primary index, so it's fast and the code is more compact. Also, we can get rid of the nth(0)
operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What? No! If anything I need to chain more methods on there. jk, i have no idea what I was thinking with that one.
|
||
# vote the block invalid | ||
vote = b.vote(block, b.get_last_voted_block()['id'], False) | ||
b.write_vote(block, vote, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the block_number
be 3
instead of 2
? Should work anyway in the context of the test.
Same here:
https://github.com/bigchaindb/bigchaindb/pull/324/files#diff-5dbcdadd05006f510ee75ac7dae5db47R1083
Addresses #192 except for checking blocks on
get_tx_by_payload_hash
, because no tests exist for this query and I understand we're going to change it soon anyway.May also duplicate #320.
All queries now have one extra query for block validity. I haven't found a more compact/elegant way to do it.