Skip to content

Commit

Permalink
conn from parts
Browse files Browse the repository at this point in the history
Signed-off-by: George Mulhearn <gmulhearn@anonyome.com>
  • Loading branch information
gmulhearn-anonyome committed Feb 2, 2023
1 parent 66ee076 commit f1e07c0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions aries_vcx/src/handlers/connection/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@ impl Connection {
})
}

pub fn from_parts(
source_id: String,
thread_id: String,
pairwise_info: PairwiseInfo,
state: SmConnectionState,
) -> Self {
let connection_sm = match state {
SmConnectionState::Inviter(state) => {
SmConnection::Inviter(SmConnectionInviter::from(source_id, thread_id, pairwise_info, state))
}
SmConnectionState::Invitee(state) => {
SmConnection::Invitee(SmConnectionInvitee::from(source_id, thread_id, pairwise_info, state))
}
};

Self { connection_sm }
}

// ----------------------------- GETTERS ------------------------------------
pub fn get_thread_id(&self) -> String {
match &self.connection_sm {
Expand Down

0 comments on commit f1e07c0

Please sign in to comment.