-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore!: make SealedBlock.header field private #13646
Changes from 6 commits
d0668fc
93e21aa
87dd29c
22d886c
3ae156c
3d2a02b
3257083
d965673
b755d20
1ec45e1
990123b
ca1e36f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -632,15 +632,15 @@ impl<N: ProviderNodeTypes> HeaderProvider for ConsistentProvider<N> { | |
self.get_in_memory_or_storage_by_block( | ||
(*block_hash).into(), | ||
|db_provider| db_provider.header(block_hash), | ||
|block_state| Ok(Some(block_state.block_ref().block().header.header().clone())), | ||
|block_state| Ok(Some(block_state.block_ref().block().header().clone())), | ||
) | ||
} | ||
|
||
fn header_by_number(&self, num: BlockNumber) -> ProviderResult<Option<Self::Header>> { | ||
self.get_in_memory_or_storage_by_block( | ||
num.into(), | ||
|db_provider| db_provider.header_by_number(num), | ||
|block_state| Ok(Some(block_state.block_ref().block().header.header().clone())), | ||
|block_state| Ok(Some(block_state.block_ref().block().header().clone())), | ||
) | ||
} | ||
|
||
|
@@ -682,7 +682,7 @@ impl<N: ProviderNodeTypes> HeaderProvider for ConsistentProvider<N> { | |
self.get_in_memory_or_storage_by_block_range_while( | ||
range, | ||
|db_provider, range, _| db_provider.headers_range(range), | ||
|block_state, _| Some(block_state.block_ref().block().header.header().clone()), | ||
|block_state, _| Some(block_state.block_ref().block().header().clone()), | ||
|_| true, | ||
) | ||
} | ||
|
@@ -694,7 +694,7 @@ impl<N: ProviderNodeTypes> HeaderProvider for ConsistentProvider<N> { | |
self.get_in_memory_or_storage_by_block( | ||
number.into(), | ||
|db_provider| db_provider.sealed_header(number), | ||
|block_state| Ok(Some(block_state.block_ref().block().header.clone())), | ||
|block_state| Ok(Some(block_state.block_ref().block().clone())), | ||
) | ||
} | ||
|
||
|
@@ -705,7 +705,7 @@ impl<N: ProviderNodeTypes> HeaderProvider for ConsistentProvider<N> { | |
self.get_in_memory_or_storage_by_block_range_while( | ||
range, | ||
|db_provider, range, _| db_provider.sealed_headers_range(range), | ||
|block_state, _| Some(block_state.block_ref().block().header.clone()), | ||
|block_state, _| Some(block_state.block_ref().block().header().clone()), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looks like the deref coercion causes this to call the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense |
||
|_| true, | ||
) | ||
} | ||
|
@@ -719,7 +719,7 @@ impl<N: ProviderNodeTypes> HeaderProvider for ConsistentProvider<N> { | |
range, | ||
|db_provider, range, predicate| db_provider.sealed_headers_while(range, predicate), | ||
|block_state, predicate| { | ||
let header = &block_state.block_ref().block().header; | ||
let header = &block_state.block_ref().block().header(); | ||
predicate(header).then(|| header.clone()) | ||
}, | ||
predicate, | ||
|
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.
This method doesn't seem necessary, since it's just returning
self
?