Skip to content

Commit

Permalink
rename trait func
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhavyas committed Apr 11, 2024
1 parent bb88cde commit 1311af9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions substrate/frame/merkle-mountain-range/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<T: frame_system::Config> LeafDataProvider for ParentNumberAndHash<T> {

/// Block hash provider for a given block number.
pub trait BlockHashProvider<BlockNumber, BlockHash> {
fn block_hash_for(block_number: BlockNumber) -> BlockHash;
fn block_hash(block_number: BlockNumber) -> BlockHash;
}

/// Default implementation of BlockHashProvider using frame_system.
Expand All @@ -116,7 +116,7 @@ pub struct DefaultBlockHashProvider<T: frame_system::Config> {
impl<T: frame_system::Config> BlockHashProvider<BlockNumberFor<T>, T::Hash>
for DefaultBlockHashProvider<T>
{
fn block_hash_for(block_number: BlockNumberFor<T>) -> T::Hash {
fn block_hash(block_number: BlockNumberFor<T>) -> T::Hash {
frame_system::Pallet::<T>::block_hash(block_number)
}
}
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/merkle-mountain-range/src/mmr/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ where
// Fall through to searching node using fork-specific key.
let ancestor_parent_block_num =
Pallet::<T, I>::leaf_index_to_parent_block_num(ancestor_leaf_idx, leaves);
let ancestor_parent_hash = T::BlockHashProvider::block_hash_for(ancestor_parent_block_num);
let ancestor_parent_hash = T::BlockHashProvider::block_hash(ancestor_parent_block_num);
let temp_key = Pallet::<T, I>::node_temp_offchain_key(pos, ancestor_parent_hash);
debug!(
target: "runtime::mmr::offchain",
Expand Down

0 comments on commit 1311af9

Please sign in to comment.