make Pod derive from Any (#205)

This commit is contained in:
Daniel Gulotta 2025-04-22 06:06:23 -06:00 committed by GitHub
parent bf6d8aee8b
commit 58d3c6a236
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 29 additions and 56 deletions

View file

@ -654,7 +654,7 @@ impl Params {
}
}
pub trait Pod: fmt::Debug + DynClone {
pub trait Pod: fmt::Debug + DynClone + Any {
fn verify(&self) -> Result<()>;
fn id(&self) -> PodId;
fn pub_statements(&self) -> Vec<Statement>;
@ -668,9 +668,6 @@ pub trait Pod: fmt::Debug + DynClone {
})
.collect()
}
// Used for downcasting
fn into_any(self: Box<Self>) -> Box<dyn Any>;
fn as_any(&self) -> &dyn Any;
// Front-end Pods keep references to middleware Pods. Most of the
// middleware data can be derived directly from front-end data, but the
// "proof" data is only created at the point of proving/signing, and
@ -704,12 +701,6 @@ impl Pod for NonePod {
fn pub_statements(&self) -> Vec<Statement> {
Vec::new()
}
fn into_any(self: Box<Self>) -> Box<dyn Any> {
self
}
fn as_any(&self) -> &dyn Any {
self
}
fn serialized_proof(&self) -> String {
"".to_string()
}