Skip to content
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

Clippy fixes on rust 1.80 #32

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
//! This crate implements a Namespaced Merkle Tree compatible with <https://github.com/celestiaorg/nmt>. To quote from their documentation:
//!
//! > A Namespaced Merkle Tree is an ordered Merkle tree that uses a modified hash function so that each node in the tree
//! includes the range of namespaces of the messages in all of the descendants of each node. The leafs in the tree are
//! ordered by the namespace identifiers of the messages. In a namespaced Merkle tree, each non-leaf node in the tree contains
//! the lowest and highest namespace identifiers found in all the leaf nodes that are descendants of the non-leaf node, in addition
//! to the hash of the concatenation of the children of the node. This enables Merkle inclusion proofs to be created that prove to
//! a verifier that all the elements of the tree for a specific namespace have been included in a Merkle inclusion proof.
//!
//! > includes the range of namespaces of the messages in all of the descendants of each node. The leafs in the tree are
//! > ordered by the namespace identifiers of the messages. In a namespaced Merkle tree, each non-leaf node in the tree contains
//! > the lowest and highest namespace identifiers found in all the leaf nodes that are descendants of the non-leaf node, in addition
//! > to the hash of the concatenation of the children of the node. This enables Merkle inclusion proofs to be created that prove to
//! > a verifier that all the elements of the tree for a specific namespace have been included in a Merkle inclusion proof.
//! >
//! > The concept was first introduced by [@musalbas](https://github.com/musalbas) in the [LazyLedger academic paper](https://arxiv.org/abs/1905.09274).
//!
//! This implementation was developed independently by Sovereign Labs, and is not endorsed by the Celestia foundation.
//! This implementation was developed independently by [Sovereign Labs](https://www.sovereign.xyz/), and is not endorsed by the Celestia foundation.

#[cfg(not(feature = "std"))]
extern crate alloc;
Expand Down
4 changes: 2 additions & 2 deletions src/namespaced_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ impl<const NS_ID_SIZE: usize> MerkleHash for NamespacedSha2Hasher<NS_ID_SIZE> {

let mut output = NamespacedHash::with_min_and_max_ns(min_ns, max_ns);

hasher.update(&left.iter().collect::<Vec<_>>());
hasher.update(&right.iter().collect::<Vec<_>>());
hasher.update(left.iter().collect::<Vec<_>>());
hasher.update(right.iter().collect::<Vec<_>>());

output.set_hash(hasher.finalize().as_ref());
output
Expand Down
Loading