mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 05:07:12 +00:00
Removes some of the temporary re-exports in `consensus/types`. I am doing this in multiple parts to keep each diff small. Co-Authored-By: Mac L <mjladson@pm.me>
9 lines
386 B
Rust
9 lines
386 B
Rust
use ethereum_hashing::hash_fixed;
|
|
use types::{VersionedHash, kzg_ext::KzgCommitment, kzg_ext::consts::VERSIONED_HASH_VERSION_KZG};
|
|
|
|
pub fn kzg_commitment_to_versioned_hash(kzg_commitment: &KzgCommitment) -> VersionedHash {
|
|
let mut hashed_commitment = hash_fixed(&kzg_commitment.0);
|
|
hashed_commitment[0] = VERSIONED_HASH_VERSION_KZG;
|
|
VersionedHash::from(hashed_commitment)
|
|
}
|