Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional Account ID in signin flow #100

Merged
merged 6 commits into from
Apr 22, 2023
Merged

Conversation

volovyks
Copy link
Collaborator

@volovyks volovyks commented Apr 22, 2023

Added MPC_RECOVERY_ACCOUNT_LOOKUP_URL to our cloud run (both prod/mainnet and dev/testnet).
Added unit test, Integration test will require a whole wallet server or some kind of mocked get_acc function. I think we should pospone this.

@volovyks volovyks requested review from itegulov and DavidM-D April 22, 2023 20:46
@volovyks volovyks marked this pull request as ready for review April 22, 2023 20:47
@volovyks volovyks linked an issue Apr 22, 2023 that may be closed by this pull request
Copy link
Contributor

@DavidM-D DavidM-D left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

let user_recovery_pk = get_user_recovery_pk(internal_acc_id.clone());
let user_recovery_sk = get_user_recovery_sk(internal_acc_id);
let new_public_key: PublicKey = request
.public_key
.parse()
.map_err(|e| AddKeyError::MalformedPublicKey(request.public_key, e))?;

let user_account_id: AccountId = match &request.near_account_id {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle the error case of it being a list of IDs with this controlling key?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are just taking the first one now. There will be no error.
Also, we are using recovery PK. Since we allow anly one acc per our internal (firebase) Id, thre should always be one account.

@volovyks volovyks merged commit 8d3e901 into develop Apr 22, 2023
@ChaoticTempest ChaoticTempest deleted the serhii/optional-acc-id branch October 27, 2023 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the near address you're trying to recover optional
2 participants