remove unnecessary rs_merkle dep

This commit is contained in:
Sergio Chouhy 2025-10-17 16:07:59 -03:00
parent b93c0aa390
commit 7d85424948
4 changed files with 18 additions and 23 deletions

View File

@ -28,7 +28,6 @@ env_logger = "0.10"
log = "0.4.28"
lru = "0.7.8"
thiserror = "2.0.12"
rs_merkle = "1.4"
sha2 = "0.10.8"
hex = "0.4.3"
aes-gcm = "0.10.3"

View File

@ -11,7 +11,6 @@ serde.workspace = true
reqwest.workspace = true
k256.workspace = true
rs_merkle.workspace = true
sha2.workspace = true
log.workspace = true
elliptic-curve.workspace = true

View File

@ -1,7 +1,23 @@
use borsh::{BorshDeserialize, BorshSerialize};
use rs_merkle::Hasher;
use sha2::{Digest, Sha256, digest::FixedOutput};
use crate::{OwnHasher, transaction::EncodedTransaction};
use crate::transaction::EncodedTransaction;
pub type HashType = [u8; 32];
#[derive(Debug, Clone)]
///Our own hasher.
/// Currently it is SHA256 hasher wrapper. May change in a future.
pub struct OwnHasher {}
impl OwnHasher {
fn hash(data: &[u8]) -> HashType {
let mut hasher = Sha256::new();
hasher.update(data);
<HashType>::from(hasher.finalize_fixed())
}
}
pub type BlockHash = [u8; 32];
pub type BlockId = u64;

View File

@ -1,6 +1,4 @@
use rs_merkle::Hasher;
use serde::Deserialize;
use sha2::{Digest, Sha256, digest::FixedOutput};
pub mod block;
pub mod rpc_primitives;
@ -13,23 +11,6 @@ pub mod test_utils;
use rpc_primitives::errors::RpcError;
pub type HashType = [u8; 32];
pub type CommitmentHashType = Vec<u8>;
#[derive(Debug, Clone)]
///Our own hasher.
/// Currently it is SHA256 hasher wrapper. May change in a future.
pub struct OwnHasher {}
impl Hasher for OwnHasher {
type Hash = HashType;
fn hash(data: &[u8]) -> HashType {
let mut hasher = Sha256::new();
hasher.update(data);
<HashType>::from(hasher.finalize_fixed())
}
}
#[derive(Debug, Clone, Deserialize)]
pub struct SequencerRpcError {