Skip to content

Commit

Permalink
refactor(dataverse)!: change RdfFormat to RdfDatasetFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Jun 14, 2024
1 parent f54a8f9 commit d62c72e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions contracts/axone-dataverse/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ pub mod query {
#[cfg(test)]
mod tests {
use super::*;
use crate::msg::{DataverseResponse, RdfFormat, TripleStoreConfig, TripleStoreLimitsInput};
use crate::msg::{
DataverseResponse, RdfDatasetFormat, TripleStoreConfig, TripleStoreLimitsInput,
};
use crate::testutil::testutil::read_test_data;
use axone_cognitarium::msg::{
DataFormat, Head, Node, Results, SelectItem, SelectQuery, SelectResponse,
Expand Down Expand Up @@ -271,7 +273,7 @@ mod tests {

let msg = ExecuteMsg::SubmitClaims {
metadata: Binary::from("data".as_bytes()),
format: Some(RdfFormat::NQuads),
format: Some(RdfDatasetFormat::NQuads),
};

let result = execute(deps.as_mut(), env, info, msg);
Expand Down Expand Up @@ -338,7 +340,7 @@ mod tests {
mock_info("axone1072nc6egexqr2v6vpp7yxwm68plvqnkf5uemr0", &[]),
ExecuteMsg::SubmitClaims {
metadata: Binary(read_test_data("vc-eddsa-2020-ok.nq")),
format: Some(RdfFormat::NQuads),
format: Some(RdfDatasetFormat::NQuads),
},
);

Expand Down Expand Up @@ -400,7 +402,7 @@ _:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://example.org/exam
mock_info("axone1072nc6egexqr2v6vpp7yxwm68plvqnkf5uemr0", &[]),
ExecuteMsg::SubmitClaims {
metadata: Binary("notrdf".as_bytes().to_vec()),
format: Some(RdfFormat::NQuads),
format: Some(RdfDatasetFormat::NQuads),
},
);

Expand All @@ -416,7 +418,7 @@ _:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://example.org/exam
mock_info("axone1072nc6egexqr2v6vpp7yxwm68plvqnkf5uemr0", &[]),
ExecuteMsg::SubmitClaims {
metadata: Binary(vec![]),
format: Some(RdfFormat::NQuads),
format: Some(RdfDatasetFormat::NQuads),
},
);

Expand All @@ -435,7 +437,7 @@ _:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://example.org/exam
mock_info("axone1072nc6egexqr2v6vpp7yxwm68plvqnkf5uemr0", &[]),
ExecuteMsg::SubmitClaims {
metadata: Binary(read_test_data("vc-eddsa-2020-ok-unsecured.nq")),
format: Some(RdfFormat::NQuads),
format: Some(RdfDatasetFormat::NQuads),
},
);

Expand All @@ -454,7 +456,7 @@ _:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://example.org/exam
mock_info("axone1072nc6egexqr2v6vpp7yxwm68plvqnkf5uemr0", &[]),
ExecuteMsg::SubmitClaims {
metadata: Binary(read_test_data("vc-unsupported-1.nq")),
format: Some(RdfFormat::NQuads),
format: Some(RdfDatasetFormat::NQuads),
},
);

Expand Down Expand Up @@ -502,7 +504,7 @@ _:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://example.org/exam
mock_info("axone1072nc6egexqr2v6vpp7yxwm68plvqnkf5uemr0", &[]),
ExecuteMsg::SubmitClaims {
metadata: Binary(read_test_data("vc-eddsa-2020-ok.nq")),
format: Some(RdfFormat::NQuads),
format: Some(RdfDatasetFormat::NQuads),
},
);

Expand Down
4 changes: 2 additions & 2 deletions contracts/axone-dataverse/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub enum ExecuteMsg {
metadata: Binary,
/// RDF format in which the metadata is represented.
/// If not provided, the default format is [N-Quads](https://www.w3.org/TR/n-quads/) format.
format: Option<RdfFormat>,
format: Option<RdfDatasetFormat>,
},

/// # RevokeClaims
Expand Down Expand Up @@ -154,7 +154,7 @@ impl From<TripleStoreLimitsInput> for axone_cognitarium::msg::StoreLimitsInput {
/// `RdfFormat` represents the various serialization formats for RDF (Resource Description Framework) data.
#[cw_serde]
#[derive(Default)]
pub enum RdfFormat {
pub enum RdfDatasetFormat {
/// # NQuads
/// N-Quads Format
///
Expand Down

0 comments on commit d62c72e

Please sign in to comment.