Skip to content

Commit

Permalink
Merge pull request #158 from nervina-labs/parse-witness-audios
Browse files Browse the repository at this point in the history
Parse witness cota metadata with audios
  • Loading branch information
duanyytop authored May 8, 2023
2 parents 5f32813 + 91fc5a3 commit eba2206
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cota-aggregator"
version = "0.10.6"
version = "0.10.7"
edition = "2018"

[dependencies]
Expand Down
12 changes: 12 additions & 0 deletions src/response/witness/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct ClassInfo {
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub audio: Option<String>,
pub audios: Vec<ClassAudio>,
#[serde(skip_serializing_if = "Option::is_none")]
pub video: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand All @@ -32,6 +33,17 @@ pub struct ClassInfo {
pub properties: Option<String>,
}

#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
pub struct ClassAudio {
#[serde(skip_serializing_if = "Option::is_none")]
pub cota_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
pub idx: u32,
}

#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
pub struct InfoData<T> {
#[serde(skip_serializing)]
Expand Down

0 comments on commit eba2206

Please sign in to comment.