Skip to content

Commit

Permalink
:)
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
  • Loading branch information
muraca committed Mar 18, 2024
1 parent b2a6310 commit de07aee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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 @@ -224,8 +224,8 @@ pub mod pallet {
};
<T::OnNewRoot as primitives::OnNewRoot<_>>::on_new_root(&root);

<NumberOfLeaves<T, I>>::put(leaves);
<RootHash<T, I>>::put(root);
NumberOfLeaves::<T, I>::put(leaves);
RootHash::<T, I>::put(root);

let peaks_after = sp_mmr_primitives::utils::NodesUtils::new(leaves).number_of_peaks();

Expand Down
6 changes: 3 additions & 3 deletions substrate/frame/merkle-mountain-range/src/mmr/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ where
L: primitives::FullLeaf,
{
fn get_elem(&self, pos: NodeIndex) -> mmr_lib::Result<Option<NodeOf<T, I, L>>> {
Ok(<Nodes<T, I>>::get(pos).map(Node::Hash))
Ok(Nodes::<T, I>::get(pos).map(Node::Hash))
}

fn append(&mut self, pos: NodeIndex, elems: Vec<NodeOf<T, I, L>>) -> mmr_lib::Result<()> {
Expand Down Expand Up @@ -147,7 +147,7 @@ where
for elem in elems {
// On-chain we are going to only store new peaks.
if peaks_to_store.next_if_eq(&node_index).is_some() {
<Nodes<T, I>>::insert(node_index, elem.hash());
Nodes::<T, I>::insert(node_index, elem.hash());
}
// We are storing full node off-chain (using indexing API).
Self::store_to_offchain(node_index, parent_hash, &elem);
Expand All @@ -164,7 +164,7 @@ where

// And remove all remaining items from `peaks_before` collection.
for pos in peaks_to_prune {
<Nodes<T, I>>::remove(pos);
Nodes::<T, I>::remove(pos);
}

Ok(())
Expand Down

0 comments on commit de07aee

Please sign in to comment.