Implement KZG EF Tests (#4274)

This commit is contained in:
ethDreamer
2023-05-08 14:58:23 -05:00
committed by GitHub
parent 9db6b39dc3
commit a22e4bf636
13 changed files with 583 additions and 2 deletions

View File

@@ -637,6 +637,126 @@ impl<E: EthSpec + TypeName> Handler for GenesisInitializationHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
pub struct KZGBlobToKZGCommitmentHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGBlobToKZGCommitmentHandler<E> {
type Case = cases::KZGBlobToKZGCommitment<E>;
fn config_name() -> &'static str {
"general"
}
fn runner_name() -> &'static str {
"kzg"
}
fn handler_name(&self) -> String {
"blob_to_kzg_commitment".into()
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
pub struct KZGComputeBlobKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGComputeBlobKZGProofHandler<E> {
type Case = cases::KZGComputeBlobKZGProof<E>;
fn config_name() -> &'static str {
"general"
}
fn runner_name() -> &'static str {
"kzg"
}
fn handler_name(&self) -> String {
"compute_blob_kzg_proof".into()
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
pub struct KZGComputeKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGComputeKZGProofHandler<E> {
type Case = cases::KZGComputeKZGProof<E>;
fn config_name() -> &'static str {
"general"
}
fn runner_name() -> &'static str {
"kzg"
}
fn handler_name(&self) -> String {
"compute_kzg_proof".into()
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
pub struct KZGVerifyBlobKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGVerifyBlobKZGProofHandler<E> {
type Case = cases::KZGVerifyBlobKZGProof<E>;
fn config_name() -> &'static str {
"general"
}
fn runner_name() -> &'static str {
"kzg"
}
fn handler_name(&self) -> String {
"verify_blob_kzg_proof".into()
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
pub struct KZGVerifyBlobKZGProofBatchHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGVerifyBlobKZGProofBatchHandler<E> {
type Case = cases::KZGVerifyBlobKZGProofBatch<E>;
fn config_name() -> &'static str {
"general"
}
fn runner_name() -> &'static str {
"kzg"
}
fn handler_name(&self) -> String {
"verify_blob_kzg_proof_batch".into()
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
pub struct KZGVerifyKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGVerifyKZGProofHandler<E> {
type Case = cases::KZGVerifyKZGProof<E>;
fn config_name() -> &'static str {
"general"
}
fn runner_name() -> &'static str {
"kzg"
}
fn handler_name(&self) -> String {
"verify_kzg_proof".into()
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
pub struct MerkleProofValidityHandler<E>(PhantomData<E>);