Make serialized POD ids available (#350)

This commit is contained in:
Rob Knight 2025-07-22 22:43:37 +01:00 committed by GitHub
parent 757f8c0734
commit 5cdf53576b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,6 +27,12 @@ pub struct SerializedSignedPod {
data: serde_json::Value,
}
impl SerializedSignedPod {
pub fn id(&self) -> PodId {
self.id
}
}
#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
#[schemars(rename = "MainPod")]
@ -39,6 +45,12 @@ pub struct SerializedMainPod {
data: serde_json::Value,
}
impl SerializedMainPod {
pub fn id(&self) -> PodId {
self.id
}
}
impl From<SignedPod> for SerializedSignedPod {
fn from(pod: SignedPod) -> Self {
let (pod_type, pod_type_name_str) = pod.pod.pod_type();