Skip to content

Commit

Permalink
Change created to DateTimeStamp
Browse files Browse the repository at this point in the history
  • Loading branch information
sbihel committed Jul 10, 2024
1 parent 31b620d commit 91dfb2d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions crates/claims/crates/data-integrity/core/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct ProofOptions<M, T> {

/// Date a creation of the proof.
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<xsd_types::DateTime>,
pub created: Option<xsd_types::DateTimeStamp>,

/// Verification method.
pub verification_method: Option<ReferenceOrOwned<M>>,
Expand Down Expand Up @@ -74,7 +74,7 @@ impl<M, T: Default> Default for ProofOptions<M, T> {
fn default() -> Self {
Self {
context: None,
created: Some(xsd_types::DateTime::now_ms()),
created: Some(xsd_types::DateTimeStamp::now_ms()),
verification_method: None,
proof_purpose: ProofPurpose::default(),
expires: None,
Expand All @@ -89,7 +89,7 @@ impl<M, T: Default> Default for ProofOptions<M, T> {

impl<M, T> ProofOptions<M, T> {
pub fn new(
created: xsd_types::DateTime,
created: xsd_types::DateTimeStamp,
verification_method: ReferenceOrOwned<M>,
proof_purpose: ProofPurpose,
options: T,
Expand All @@ -111,7 +111,7 @@ impl<M, T> ProofOptions<M, T> {
pub fn from_method_and_options(verification_method: ReferenceOrOwned<M>, options: T) -> Self {
Self {
context: None,
created: Some(xsd_types::DateTime::now_ms()),
created: Some(xsd_types::DateTimeStamp::now_ms()),
verification_method: Some(verification_method),
proof_purpose: ProofPurpose::default(),
expires: None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct ProofConfiguration<S: CryptographicSuite> {

/// Date a creation of the proof.
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<xsd_types::DateTime>,
pub created: Option<xsd_types::DateTimeStamp>,

/// Verification method.
#[serde(serialize_with = "S::serialize_verification_method_ref")]
Expand Down Expand Up @@ -90,7 +90,7 @@ pub struct ProofConfiguration<S: CryptographicSuite> {
impl<S: CryptographicSuite> ProofConfiguration<S> {
pub fn new(
type_: S,
created: xsd_types::DateTime,
created: xsd_types::DateTimeStamp,
verification_method: ReferenceOrOwned<S::VerificationMethod>,
proof_purpose: ProofPurpose,
options: S::ProofOptions,
Expand Down Expand Up @@ -118,7 +118,7 @@ impl<S: CryptographicSuite> ProofConfiguration<S> {
Self {
context: None,
type_,
created: Some(xsd_types::DateTime::now_ms()),
created: Some(xsd_types::DateTimeStamp::now_ms()),
verification_method,
proof_purpose: ProofPurpose::default(),
expires: None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct ProofConfigurationRef<'a, S: CryptographicSuite> {
pub type_: &'a S,

#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<xsd_types::DateTime>,
pub created: Option<xsd_types::DateTimeStamp>,

#[serde(serialize_with = "S::serialize_verification_method_ref_ref")]
pub verification_method: ReferenceOrOwnedRef<'a, S::VerificationMethod>,
Expand Down Expand Up @@ -141,7 +141,7 @@ pub struct ProofConfigurationRefWithoutOptions<'a, S: CryptographicSuite> {
pub type_: &'a S,

#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<xsd_types::DateTime>,
pub created: Option<xsd_types::DateTimeStamp>,

#[serde(serialize_with = "S::serialize_verification_method_ref_ref")]
pub verification_method: ReferenceOrOwnedRef<'a, S::VerificationMethod>,
Expand Down
4 changes: 2 additions & 2 deletions crates/claims/crates/data-integrity/core/src/proof/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct Proof<S: CryptographicSuite> {

/// Date a creation of the proof.
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<xsd_types::DateTime>,
pub created: Option<xsd_types::DateTimeStamp>,

/// Verification method.
#[serde(serialize_with = "S::serialize_verification_method_ref")]
Expand Down Expand Up @@ -113,7 +113,7 @@ impl<T: CryptographicSuite> Proof<T> {
/// Creates a new proof.
pub fn new(
type_: T,
created: xsd_types::DateTime,
created: xsd_types::DateTimeStamp,
verification_method: ReferenceOrOwned<T::VerificationMethod>,
proof_purpose: ProofPurpose,
options: T::ProofOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct ProofRef<'a, S: CryptographicSuite> {

pub type_: &'a S,

pub created: Option<xsd_types::DateTime>,
pub created: Option<xsd_types::DateTimeStamp>,

pub verification_method: ReferenceOrOwnedRef<'a, S::VerificationMethod>,

Expand Down

0 comments on commit 91dfb2d

Please sign in to comment.