minor refactoring

This commit is contained in:
Hsiao-Wei Wang 2023-11-02 22:10:06 +07:00
parent 71106f1d64
commit 3492c0a99a
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4

View File

@ -97,11 +97,12 @@ class BlobIdentifier(Container):
```python
def verify_blob_sidecar_inclusion_proof(blob_sidecar: BlobSidecar) -> bool:
gindex = get_subtree_index(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments', blob_sidecar.index))
return is_valid_merkle_branch(
leaf=blob_sidecar.kzg_commitment.hash_tree_root(),
branch=blob_sidecar.kzg_commitment_inclusion_proof,
depth=KZG_COMMITMENT_INCLUSION_PROOF_DEPTH,
index=get_subtree_index(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments', blob_sidecar.index)),
index=gindex,
root=blob_sidecar.signed_block_header.message.body_root,
)
```