-
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
Block header repo removed #2286
base: master
Are you sure you want to change the base?
Block header repo removed #2286
Conversation
@@ -60,7 +60,7 @@ namespace kagome::blockchain { | |||
outcome::result<primitives::BlockHash> putBlockHeader( | |||
const primitives::BlockHeader &header) override; | |||
|
|||
outcome::result<std::optional<primitives::BlockHeader>> getBlockHeader( | |||
outcome::result<primitives::BlockHeader> getBlockHeader( |
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 should be the other way around, BlockHeaderRepository should return an optional header. However, it's hard to refactor it now since it's used in a mighty lot of places. So here where it's already done correctly changing it to the worse BlockHeaderRepository interface is not supported by me.
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.
In many (if not all) cases nullopt result was considered as an error but processed outside. It's much more simple to return block_not_found error right from this function.
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.
Added tryGetBlockHeader to block_storage so as unit tests for both get and tryGet methods
f1d8bcd
to
ad8b83b
Compare
18554b8
to
23eef0b
Compare
…factor-block-tree-and-header-repo
Referenced issues
Closes #2255
Description of the Change
Possible Drawbacks
Checklist Before Opening a PR
Before you open a Pull Request (PR), please make sure you've completed the following steps and confirm by answering 'Yes' to each item: