-
Notifications
You must be signed in to change notification settings - Fork 34
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
Refactor: block validation #1873
Conversation
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
return consensus; | ||
} | ||
} | ||
BOOST_UNREACHABLE_RETURN({}); |
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.
Do we want to put some SL_CRITICAL message before the macro?
// In order to ease possible debugging after the later changes
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.
It really unreachable. At least one (last) consensus will be returned as fallback. Empty list throws exception (assert) in ctor
|
||
// TODO: Code for trying to select another consensus | ||
} | ||
BOOST_UNREACHABLE_RETURN({}); |
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.
I suggest covering such cases with log messages, since the code may change and the line might got reached.
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.
Likely I'll remove selector for finality consensus.
using testing::Mock; | ||
using testing::Return; | ||
|
||
class BabeBlockValidatorTest : public testing::Test { |
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.
💪
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Referenced issues
Needed for #1591 (as part of preparation for sassafras block validation develop)
Description of the Change
Makes block validation consensus agnostic as more as possible: bock validation will be called from consensus.
This is needed to make validation block internally particular consensus