Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove PartialOrd trait from mmr hash type
  • Loading branch information
Lederstrumpf committed May 18, 2023
commit 0cb698a3c84338b30a816d3c47c08ff141bfda95
3 changes: 1 addition & 2 deletions frame/merkle-mountain-range/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ pub mod pallet {
+ codec::Codec
+ codec::EncodeLike
+ scale_info::TypeInfo
+ MaxEncodedLen
+ PartialOrd;
+ MaxEncodedLen;

/// Data stored in the leaf nodes.
///
Expand Down
10 changes: 5 additions & 5 deletions utils/binary-merkle-tree/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use hash_db::Hasher;
pub fn merkle_root<H, I>(leaves: I) -> H::Out
where
H: Hasher,
H::Out: Default + AsRef<[u8]> + PartialOrd,
H::Out: Default + AsRef<[u8]>,
I: IntoIterator,
I::Item: AsRef<[u8]>,
{
Expand All @@ -58,7 +58,7 @@ where
fn merkelize<H, V, I>(leaves: I, visitor: &mut V) -> H::Out
where
H: Hasher,
H::Out: Default + AsRef<[u8]> + PartialOrd,
H::Out: Default + AsRef<[u8]>,
V: Visitor<H::Out>,
I: Iterator<Item = H::Out>,
{
Expand Down Expand Up @@ -143,7 +143,7 @@ impl<T> Visitor<T> for () {
pub fn merkle_proof<H, I, T>(leaves: I, leaf_index: usize) -> MerkleProof<H::Out, T>
where
H: Hasher,
H::Out: Default + Copy + AsRef<[u8]> + PartialOrd,
H::Out: Default + Copy + AsRef<[u8]>,
I: IntoIterator<Item = T>,
I::IntoIter: ExactSizeIterator,
T: AsRef<[u8]>,
Expand Down Expand Up @@ -243,7 +243,7 @@ pub fn verify_proof<'a, H, P, L>(
) -> bool
where
H: Hasher,
H::Out: PartialEq + AsRef<[u8]> + PartialOrd,
H::Out: PartialEq + AsRef<[u8]>,
P: IntoIterator<Item = H::Out>,
L: Into<Leaf<'a, H::Out>>,
{
Expand Down Expand Up @@ -297,7 +297,7 @@ fn merkelize_row<H, V, I>(
) -> Result<H::Out, Vec<H::Out>>
where
H: Hasher,
H::Out: AsRef<[u8]> + PartialOrd,
H::Out: AsRef<[u8]>,
V: Visitor<H::Out>,
I: Iterator<Item = H::Out>,
{
Expand Down