Skip to content

Commit

Permalink
added addr getter method
Browse files Browse the repository at this point in the history
  • Loading branch information
mfahampshire committed Sep 20, 2024
1 parent b77021e commit 637330f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sdk/ffi/shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ pub fn proxy_server_new_internal(
}
Ok(())
}

// run w shutdown
pub fn proxy_server_run_internal() -> anyhow::Result<(), anyhow::Error> {
let mut proxy_server = NYM_PROXY_SERVER
Expand All @@ -264,3 +265,17 @@ pub fn proxy_server_run_internal() -> anyhow::Result<(), anyhow::Error> {
})?;
Ok(())
}

// get nym addr
pub fn proxy_server_address_internal() -> anyhow::Result<Recipient, anyhow::Error> {
let mut proxy_server = NYM_PROXY_SERVER
.lock()
.expect("could not lock NYM_PROXY_CLIENT");
if proxy_server.is_none() {
bail!("Server is not yet initialised");
}
let proxy = proxy_server
.as_mut()
.ok_or_else(|| anyhow!("could not get proxy_client as_ref()"))?;
Ok(proxy.nym_address().to_owned())
}

0 comments on commit 637330f

Please sign in to comment.