-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: remove Option<BlockHeight>
and use new enum where applicable
#2033
base: master
Are you sure you want to change the base?
Conversation
@@ -508,7 +508,7 @@ where | |||
off_chain_height.map(|height| BlockHeight::new(height.saturating_add(1))); | |||
|
|||
let import_result = | |||
import_result_provider.block_event_at_height(next_block_height)?; | |||
import_result_provider.block_event_at_height(next_block_height.into())?; |
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.
Is it possible to make on_chain_database.latest_height()
return BlockHeightQuery
?
This makes me think that the name should be something different.
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.
We could change latest_height()
to return BlockHeightQuery
. I didn't do this because, IIUC, a database should be able to return None if it can't find the requested key. Is the genesis block stored in the DB? I agree the name BlockHeightQuery
isn't quite right. The only other name I can think of is SpecificBlockOrGenesis
@matt-user / @MitchTurner can I just regen the state transition bytecode, run tests again and then merge? |
Ah dang. Sorry @matt-user I thought this got merged :o |
Hello @matt-user , Sorry for letting your PR became stale like this. Are you ok to resolve the conflicts so that we can gett this merge soonish ? If you prefer we can take care of the conflicts for you, let me know :) |
Yeah sorry, I completely forgot about this. I will resolve the conflicts |
crates/fuel-core/src/service/adapters/import_result_provider.rs
Outdated
Show resolved
Hide resolved
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.
LGTM
@@ -37,38 +37,42 @@ impl ImportResultProvider { | |||
impl ImportResultProvider { | |||
pub fn result_at_height( |
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.
The mentioned issue was only related to this part of the code: #2004 (comment)
All other changes are not needed. All other places uses None
because it means no prefix or not starting block
Fixed the changelog entry
closes #2005
I replaced
Option<BlockHeight>
withBlockHeightQuery
where applicable. IIUC there areOption<BlockHeight>
which should remain.Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]