Skip to content

Commit

Permalink
Sanitize address before inbox ID lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine committed Jun 24, 2024
1 parent 1e09690 commit 1c40c6c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions xmtp_mls/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,15 @@ where
&self,
address: String,
) -> Result<Option<String>, ClientError> {
let mut results = self.api_client.get_inbox_ids(vec![address.clone()]).await?;
Ok(results.remove(&address))
if let Some(sanitized_address) = sanitize_evm_addresses(vec![address])?.pop() {
let mut results = self
.api_client
.get_inbox_ids(vec![sanitized_address.clone()])
.await?;
Ok(results.remove(&sanitized_address))
} else {
Ok(None)
}
}

/// Get sequence id, may not be consistent with the backend
Expand Down

0 comments on commit 1c40c6c

Please sign in to comment.