remove NonePod and use dummy signed pods (#272)

* remove NonePod and use dummy signed pods

* apply suggestion by @arnaucube
This commit is contained in:
Eduard S. 2025-06-13 10:14:15 +02:00 committed by GitHub
parent 03485d6fd3
commit 3b4edab1f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 54 additions and 49 deletions

View file

@ -599,7 +599,6 @@ impl ToFields for PodId {
#[derive(Clone, Copy, Debug, PartialEq, Eq, FromRepr, Serialize, Deserialize, JsonSchema)]
pub enum PodType {
None = 0,
MockSigned = 1,
MockMain = 2,
MockEmpty = 3,
@ -611,7 +610,6 @@ pub enum PodType {
impl fmt::Display for PodType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
PodType::None => write!(f, "None"),
PodType::MockSigned => write!(f, "MockSigned"),
PodType::MockMain => write!(f, "MockMain"),
PodType::MockEmpty => write!(f, "MockEmpty"),
@ -837,34 +835,6 @@ pub trait PodSigner {
) -> Result<Box<dyn Pod>, Box<DynError>>;
}
// TODO: Delete once we have a fully working EmptyPod and a dumb SignedPod
// https://github.com/0xPARC/pod2/issues/246
/// This is a filler type that fulfills the Pod trait and always verifies. It's empty. This
/// can be used to simulate padding in a circuit.
#[derive(Debug, Clone)]
pub struct NonePod {}
impl Pod for NonePod {
fn params(&self) -> &Params {
panic!("NonePod doesn't have params");
}
fn verify(&self) -> Result<(), Box<DynError>> {
Ok(())
}
fn id(&self) -> PodId {
PodId(EMPTY_HASH)
}
fn pod_type(&self) -> (usize, &'static str) {
(PodType::None as usize, "None")
}
fn pub_self_statements(&self) -> Vec<Statement> {
Vec::new()
}
fn serialize_data(&self) -> serde_json::Value {
serde_json::Value::Null
}
}
#[derive(Debug)]
pub struct MainPodInputs<'a> {
pub signed_pods: &'a [&'a dyn Pod],