Skip to content

Commit

Permalink
fix http client new
Browse files Browse the repository at this point in the history
  • Loading branch information
insipx committed Aug 13, 2024
1 parent 6e19c81 commit 0dce5c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions bindings_wasm/src/mls_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub async fn create_client(
encryption_key: Option<Uint8Array>,
history_sync_url: Option<String>,
) -> Result<WasmClient, JsError> {
let api_client = XmtpHttpApiClient::new(host.clone());
let api_client = XmtpHttpApiClient::new(host.clone()).unwrap();

let storage_option = StorageOption::Ephemeral;
let store = match encryption_key {
Expand Down Expand Up @@ -86,7 +86,10 @@ pub async fn get_inbox_id_for_address(
account_address: String,
) -> Result<Option<String>, JsError> {
let account_address = account_address.to_lowercase();
let api_client = ApiClientWrapper::new(XmtpHttpApiClient::new(host.clone()), Retry::default());
let api_client = ApiClientWrapper::new(
XmtpHttpApiClient::new(host.clone()).unwrap(),
Retry::default(),
);

let results = api_client
.get_inbox_ids(vec![account_address.clone()])
Expand Down
2 changes: 1 addition & 1 deletion xmtp_api_http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ mod tests {

#[tokio::test]
async fn test_register_installation() {
let client = XmtpHttpApiClient::new(ApiUrls::LOCAL_ADDRESS.to_string());
let client = XmtpHttpApiClient::new(ApiUrls::LOCAL_ADDRESS.to_string()).unwrap();
let result = client
.register_installation(RegisterInstallationRequest {
is_inbox_id_credential: false,
Expand Down
4 changes: 2 additions & 2 deletions xmtp_mls/src/utils/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ pub fn rand_time() -> i64 {
#[cfg(feature = "http-api")]
impl XmtpTestClient for XmtpHttpApiClient {
async fn create_local() -> Self {
XmtpHttpApiClient::new("http://localhost:5555".into())
XmtpHttpApiClient::new("http://localhost:5555".into()).unwrap()
}

async fn create_dev() -> Self {
XmtpHttpApiClient::new("https://grpc.dev.xmtp.network:443".into())
XmtpHttpApiClient::new("https://grpc.dev.xmtp.network:443".into()).unwrap()
}
}

Expand Down

0 comments on commit 0dce5c5

Please sign in to comment.