Skip to content

Commit

Permalink
lint: appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfertel committed May 1, 2024
1 parent e1cc212 commit c5a9b7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/crypto/src/merkle/keccak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::hash::{BuildHasher, Hasher};
/// proofs][super].
///
/// It instantiates a [`Keccak256`] hasher.
#[derive(Default)]
#[allow(clippy::module_name_repetitions)]
pub struct KeccakBuilder;

impl BuildHasher for KeccakBuilder {
Expand All @@ -24,6 +24,7 @@ impl BuildHasher for KeccakBuilder {
///
/// The underlying implementation is guaranteed to match that of the
/// `keccak256` algorithm, commonly used in Ethereum.
#[allow(clippy::module_name_repetitions)]
pub struct Keccak256(Keccak);

impl Hasher for Keccak256 {
Expand Down
6 changes: 3 additions & 3 deletions lib/crypto/src/merkle/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//! This module deals with verification of Merkle Tree proofs.
//!
//! The tree and the proofs can be generated using OpenZeppelin's
//! The tree and the proofs can be generated using `OpenZeppelin`'s
//! <https://github.com/OpenZeppelin/merkle-tree>.
//! You will find a quickstart guide in its README.
//!
//! WARNING: You should avoid using leaf values that are 64 bytes long
//! prior to hashing, or use a hash function other than keccak256 for
//! hashing leaves. This is because the concatenation of a sorted pair
//! of internal nodes in the Merkle tree could be reinterpreted as a
//! leaf value. OpenZeppelin's JavaScript library generates Merkle trees
//! leaf value. `OpenZeppelin`'s JavaScript library generates Merkle trees
//! that are safe against this attack out of the box.
use alloc::vec::Vec;
use core::marker::PhantomData;
Expand Down Expand Up @@ -469,7 +469,7 @@ mod tests {
let verification = Verifier::verify(&proof, root, leaf_a);
assert!(verification);

let builder = KeccakBuilder::default().build_hasher();
let builder = KeccakBuilder.build_hasher();
let no_such_leaf = hash_sorted_pair(leaf_a, leaf_b, builder);
let proof = &proof[1..];
let verification = Verifier::verify(proof, root, no_such_leaf);
Expand Down

0 comments on commit c5a9b7f

Please sign in to comment.