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

[MMI] 4564 - fix the way get custody type was being done #22950

Merged
merged 4 commits into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/scripts/controllers/mmi-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,18 @@ export default class MMIController extends EventEmitter {
}

async handleMmiCheckIfTokenIsPresent(req) {
const { token, envName } = req.params;
// TODO (Bernardo) - Check if this is the case
const custodyType = 'Custody - JSONRPC'; // Only JSONRPC is supported for now
const { token, envName, address } = req.params;

const currentAddress =
address || this.preferencesController.getSelectedAddress();
const currentCustodyType = this.custodyController.getCustodyTypeByAddress(
toChecksumHexAddress(currentAddress),
);

// This can only work if the extension is unlocked
await this.appStateController.getUnlockPromise(true);

const keyring = await this.addKeyringIfNotExists(custodyType);
const keyring = await this.addKeyringIfNotExists(currentCustodyType);

return await this.custodyController.handleMmiCheckIfTokenIsPresent({
token,
Expand Down