use tiny_keccak::{Hasher, Keccak}; use crate::helpers::chainsig::ChainSig; pub struct Evm {} impl ChainSig for Evm { fn prepare_transaction_for_signing(encoded_tx: String) -> Vec { let serialized_tx_bytes = hex::decode(encoded_tx.trim_start_matches("0x")).expect("Invalid hex"); let mut hasher = Keccak::v256(); hasher.update(&serialized_tx_bytes); let mut tx_hash_bytes = [0u8; 32]; hasher.finalize(&mut tx_hash_bytes); vec![hex::encode(tx_hash_bytes)].into() } }