Skip to content

Commit

Permalink
remove a param
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Nov 22, 2024
1 parent f0bb141 commit ca89653
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 38 deletions.
7 changes: 3 additions & 4 deletions bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,11 @@ impl FfiXmtpClient {
/// Adds a wallet address to the existing client
pub async fn add_wallet(
&self,
existing_wallet_address: &str,
new_wallet_address: &str,
) -> Result<Arc<FfiSignatureRequest>, GenericError> {
let signature_request = self
.inner_client
.associate_wallet(existing_wallet_address.into(), new_wallet_address.into())
.associate_wallet(new_wallet_address.into())
.await?;
let scw_verifier = self.inner_client.scw_verifier().clone();
let request = Arc::new(FfiSignatureRequest {
Expand Down Expand Up @@ -2245,7 +2244,7 @@ mod tests {
println!("second address: {}", new_account_address);

let signature_request = client
.add_wallet(&ffi_inbox_owner.get_address(), &new_account_address)
.add_wallet(&new_account_address)
.await
.expect("could not add wallet");

Expand Down Expand Up @@ -2313,7 +2312,7 @@ mod tests {
println!("second address: {}", new_account_address);

let signature_request = client
.add_wallet(&ffi_inbox_owner.get_address(), &new_account_address)
.add_wallet(&new_account_address)
.await
.expect("could not add wallet");

Expand Down
11 changes: 2 additions & 9 deletions bindings_node/src/signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,10 @@ impl Client {
}

#[napi]
pub async fn add_wallet_signature_text(
&self,
existing_wallet_address: String,
new_wallet_address: String,
) -> Result<String> {
pub async fn add_wallet_signature_text(&self, new_wallet_address: String) -> Result<String> {
let signature_request = self
.inner_client()
.associate_wallet(
existing_wallet_address.to_lowercase(),
new_wallet_address.to_lowercase(),
)
.associate_wallet(new_wallet_address.to_lowercase())
.await
.map_err(ErrorWrapper::from)?;
let signature_text = signature_request.signature_text();
Expand Down
11 changes: 0 additions & 11 deletions bindings_node/test/Client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ describe('Client', () => {
)
expect(signatureText).toBeDefined()

// sign message
// const signature = await user.wallet.signMessage({
// message: signatureText,
// })
const signature2 = await user2.wallet.signMessage({
message: signatureText,
})
Expand Down Expand Up @@ -107,17 +103,10 @@ describe('Client', () => {
expect(signatureText).toBeDefined()

// sign message
const signature = await user.wallet.signMessage({
message: signatureText,
})
const signature2 = await user2.wallet.signMessage({
message: signatureText,
})

// await client.addSignature(
// SignatureRequestType.AddWallet,
// toBytes(signature)
// )
await client.addSignature(
SignatureRequestType.AddWallet,
toBytes(signature2)
Expand Down
6 changes: 1 addition & 5 deletions bindings_wasm/src/signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,11 @@ impl Client {
#[wasm_bindgen(js_name = addWalletSignatureText)]
pub async fn add_wallet_signature_text(
&self,
existing_wallet_address: String,
new_wallet_address: String,
) -> Result<String, JsError> {
let signature_request = self
.inner_client()
.associate_wallet(
existing_wallet_address.to_lowercase(),
new_wallet_address.to_lowercase(),
)
.associate_wallet(new_wallet_address.to_lowercase())
.await
.map_err(|e| JsError::new(format!("{}", e).as_str()))?;
let signature_text = signature_request.signature_text();
Expand Down
13 changes: 4 additions & 9 deletions xmtp_mls/src/identity_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ where
/// Generate a `AssociateWallet` signature request using an existing wallet and a new wallet address
pub async fn associate_wallet(
&self,
existing_wallet_address: String,
new_wallet_address: String,
) -> Result<SignatureRequest, ClientError> {
tracing::info!("Associating new wallet with inbox_id {}", self.inbox_id());
Expand All @@ -289,10 +288,6 @@ where
let new_member_identifier: MemberIdentifier = new_wallet_address.into();

let mut signature_request = builder
// .add_association(
// new_member_identifier.clone(),
// existing_wallet_address.into(),
// )
.add_association(
new_member_identifier.clone(),
installation_public_key.into(),
Expand Down Expand Up @@ -625,7 +620,7 @@ pub(crate) mod tests {
let client = ClientBuilder::new_test_client(&wallet).await;

let mut add_association_request = client
.associate_wallet(wallet_address.clone(), wallet_2_address.clone())
.associate_wallet(wallet_2_address.clone())
.await
.unwrap();

Expand Down Expand Up @@ -679,7 +674,7 @@ pub(crate) mod tests {
assert_logged!("Wrote association", 1);

let mut add_association_request = client
.associate_wallet(wallet_address.clone(), wallet_2_address.clone())
.associate_wallet(wallet_2_address.clone())
.await
.unwrap();

Expand Down Expand Up @@ -760,7 +755,7 @@ pub(crate) mod tests {
.unwrap();
let new_wallet = generate_local_wallet();
let mut add_association_request = client
.associate_wallet(wallet.get_address(), new_wallet.get_address())
.associate_wallet(new_wallet.get_address())
.await
.unwrap();

Expand Down Expand Up @@ -840,7 +835,7 @@ pub(crate) mod tests {
let client = ClientBuilder::new_test_client(&recovery_wallet).await;

let mut add_wallet_signature_request = client
.associate_wallet(recovery_wallet.get_address(), second_wallet.get_address())
.associate_wallet(second_wallet.get_address())
.await
.unwrap();

Expand Down

0 comments on commit ca89653

Please sign in to comment.