Skip to content

Commit

Permalink
fix: Did type in message crate
Browse files Browse the repository at this point in the history
Signed-off-by: GHkrishna <[email protected]>
  • Loading branch information
GHkrishna committed Mar 31, 2024
1 parent 09144f1 commit a166420
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use did_parser_nom::Did;
use serde::{Deserialize, Serialize};
use typed_builder::TypedBuilder;

Expand All @@ -7,7 +8,7 @@ use super::InvitationContent;
#[builder(build_method(into = InvitationContent))]
pub struct PublicInvitationContent {
pub label: String,
pub did: String,
pub did: Did,
}

#[cfg(test)]
Expand Down
5 changes: 3 additions & 2 deletions aries/messages/src/msg_fields/protocols/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod request;
pub mod response;

use derive_more::From;
use did_parser_nom::Did;
use diddoc_legacy::aries::diddoc::AriesDidDoc;
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};

Expand Down Expand Up @@ -76,13 +77,13 @@ impl DelayedSerde for Connection {
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
pub struct ConnectionData {
#[serde(rename = "DID")]
pub did: String,
pub did: Did,
#[serde(rename = "DIDDoc")]
pub did_doc: AriesDidDoc,
}

impl ConnectionData {
pub fn new(did: String, did_doc: AriesDidDoc) -> Self {
pub fn new(did: Did, did_doc: AriesDidDoc) -> Self {
Self { did, did_doc }
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use did_parser_nom::Did;
use serde::{Deserialize, Serialize};
use shared::maybe_known::MaybeKnown;
use typed_builder::TypedBuilder;
Expand All @@ -18,7 +19,7 @@ pub struct RequestContent {
pub label: String,
pub goal_code: Option<MaybeKnown<ThreadGoalCode>>,
pub goal: Option<String>,
pub did: String, // TODO: Use Did
pub did: Did,
#[serde(rename = "did_doc~attach")]
pub did_doc: Option<Attachment>,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use did_parser_nom::Did;
use serde::{Deserialize, Serialize};
use typed_builder::TypedBuilder;

Expand All @@ -10,7 +11,7 @@ pub type Response = MsgParts<ResponseContent, ResponseDecorators>;

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, TypedBuilder)]
pub struct ResponseContent {
pub did: String, // TODO: Use Did
pub did: Did,
#[serde(rename = "did_doc~attach")]
pub did_doc: Option<Attachment>,
}
Expand Down

0 comments on commit a166420

Please sign in to comment.