mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-07-25 23:23:11 +00:00
rename TreeHashType to HashType
This commit is contained in:
+4
-7
@@ -12,7 +12,7 @@ pub mod test_utils;
|
||||
|
||||
use rpc_primitives::errors::RpcError;
|
||||
|
||||
pub type TreeHashType = [u8; 32];
|
||||
pub type HashType = [u8; 32];
|
||||
pub type CommitmentHashType = Vec<u8>;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -21,19 +21,16 @@ pub type CommitmentHashType = Vec<u8>;
|
||||
pub struct OwnHasher {}
|
||||
|
||||
impl Hasher for OwnHasher {
|
||||
type Hash = TreeHashType;
|
||||
type Hash = HashType;
|
||||
|
||||
fn hash(data: &[u8]) -> TreeHashType {
|
||||
fn hash(data: &[u8]) -> HashType {
|
||||
let mut hasher = Sha256::new();
|
||||
|
||||
hasher.update(data);
|
||||
<TreeHashType>::from(hasher.finalize_fixed())
|
||||
<HashType>::from(hasher.finalize_fixed())
|
||||
}
|
||||
}
|
||||
|
||||
///Account id on blockchain
|
||||
pub type AccountId = TreeHashType;
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct SequencerRpcError {
|
||||
pub jsonrpc: String,
|
||||
|
||||
@@ -91,7 +91,7 @@ mod tests {
|
||||
use sha2::{Digest, digest::FixedOutput};
|
||||
|
||||
use crate::{
|
||||
TreeHashType,
|
||||
HashType,
|
||||
transaction::{EncodedTransaction, TxKind},
|
||||
};
|
||||
|
||||
@@ -109,7 +109,7 @@ mod tests {
|
||||
let data = borsh::to_vec(&body).unwrap();
|
||||
let mut hasher = sha2::Sha256::new();
|
||||
hasher.update(&data);
|
||||
TreeHashType::from(hasher.finalize_fixed())
|
||||
HashType::from(hasher.finalize_fixed())
|
||||
};
|
||||
|
||||
let hash = body.hash();
|
||||
|
||||
Reference in New Issue
Block a user