use std::path::Path;
use axiom_eth::{
halo2_proofs::plonk::ProvingKey, halo2curves::bn256::G1Affine,
utils::build_utils::pinning::aggregation::AggTreeId,
};
use enum_dispatch::enum_dispatch;
use serde::{Deserialize, Serialize};
use self::{
agg::{
axiom_agg_1::RecursiveAxiomAgg1Intent, axiom_agg_2::RecursiveAxiomAgg2Intent,
common::AggTreePinning, single_type::*, subquery_agg::RecursiveSubqueryAggIntent,
SupportedAggPinning,
},
shard::{keccak::ShardIntentKeccak, *},
};
pub mod agg;
pub mod shard;
pub type CircuitId = String;
#[derive(Serialize, Deserialize)]
#[enum_dispatch(ProvingKeySerializer)]
pub enum SupportedRecursiveIntent {
Subquery(SupportedIntentTreeSingleType),
VerifyCompute(CircuitIntentVerifyCompute),
SubqueryAgg(RecursiveSubqueryAggIntent),
Keccak(IntentTreeSingleType<ShardIntentKeccak>),
AxiomAgg1(RecursiveAxiomAgg1Intent),
AxiomAgg2(RecursiveAxiomAgg2Intent),
}
#[derive(Serialize, Deserialize, Clone)]
#[enum_dispatch(AggTreePinning)]
pub enum SupportedPinning {
Shard(SupportedShardPinning),
Agg(SupportedAggPinning),
}
#[enum_dispatch]
pub trait ProvingKeySerializer: Sized {
fn create_and_serialize_proving_key(
self,
params_dir: &Path,
data_dir: &Path,
) -> anyhow::Result<(AggTreeId, ProvingKey<G1Affine>, SupportedPinning)>;
}