mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-18 04:13:00 +00:00
Update Blob Storage Structure (#4104)
* Initial Changes to Blob Storage * Add Arc to SignedBlobSidecar Definition
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use super::*;
|
||||
use ethereum_types::{H160, H256, U128, U256};
|
||||
use std::sync::Arc;
|
||||
|
||||
fn int_to_hash256(int: u64) -> Hash256 {
|
||||
let mut bytes = [0; HASHSIZE];
|
||||
@@ -186,6 +187,24 @@ impl TreeHash for H256 {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: TreeHash> TreeHash for Arc<T> {
|
||||
fn tree_hash_type() -> TreeHashType {
|
||||
T::tree_hash_type()
|
||||
}
|
||||
|
||||
fn tree_hash_packed_encoding(&self) -> PackedEncoding {
|
||||
self.as_ref().tree_hash_packed_encoding()
|
||||
}
|
||||
|
||||
fn tree_hash_packing_factor() -> usize {
|
||||
T::tree_hash_packing_factor()
|
||||
}
|
||||
|
||||
fn tree_hash_root(&self) -> Hash256 {
|
||||
self.as_ref().tree_hash_root()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user