Update Blob Storage Structure (#4104)

* Initial Changes to Blob Storage

* Add Arc to SignedBlobSidecar Definition
This commit is contained in:
ethDreamer
2023-03-21 14:33:06 -05:00
committed by GitHub
parent b40dceaae9
commit d1e653cfdb
9 changed files with 86 additions and 124 deletions

View File

@@ -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::*;