Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: did type in message crates #1179

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading