mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-25 13:07:18 +00:00
brought algorithm in TreeHash macro to spec
This commit is contained in:
parent
684ef9f74c
commit
8a768819b0
@ -147,12 +147,12 @@ pub fn ssz_tree_hash_derive(input: TokenStream) -> TokenStream {
|
||||
let output = quote! {
|
||||
impl ssz::TreeHash for #name {
|
||||
fn hash_tree_root_internal(&self) -> Vec<u8> {
|
||||
let mut result: Vec<u8> = vec![];
|
||||
let mut list: Vec<Vec<u8>> = Vec::new();
|
||||
#(
|
||||
result.append(&mut self.#field_idents.hash_tree_root_internal());
|
||||
list.push(self.#field_idents.hash_tree_root_internal());
|
||||
)*
|
||||
|
||||
ssz::hash(&result)
|
||||
ssz::merkle_hash(&mut list)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user