Skip to content

Commit

Permalink
Cater for libvcx_core unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
  • Loading branch information
Patrik-Stas committed Aug 20, 2023
1 parent b1ff537 commit db19087
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aries_vcx/src/handlers/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ pub(crate) use get_attach_as_string;
pub(crate) use make_attach_from_str;
pub(crate) use matches_opt_thread_id;
pub(crate) use matches_thread_id;
use crate::global::settings;

pub fn verify_thread_id(thread_id: &str, message: &AriesMessage) -> VcxResult<()> {
// todo: ultimately remove this - improve tests
// libvcx_core unit tests are passing in hardcoded message which have mismatching thid
if settings::indy_mocks_enabled() {
return Ok(())
}
let is_match = match message {
AriesMessage::BasicMessage(msg) => matches_opt_thread_id!(msg, thread_id),
AriesMessage::Connection(Connection::Invitation(Invitation::Public(msg))) => msg.id == thread_id,
Expand Down

0 comments on commit db19087

Please sign in to comment.