mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Reject Trezor eth_getEncryptionPublicKey requests (#10330)
Further implements request rejection on eth_getEncryptionPublicKey for Trezor as they do not implement this method either.
This commit is contained in:
parent
12161bb0c6
commit
6a89261f28
@ -1645,18 +1645,34 @@ export default class MetamaskController extends EventEmitter {
|
||||
async newRequestEncryptionPublicKey(msgParams, req) {
|
||||
const address = msgParams
|
||||
const keyring = await this.keyringController.getKeyringForAccount(address)
|
||||
if (keyring.type === 'Ledger Hardware') {
|
||||
return new Promise((_, reject) => {
|
||||
reject(new Error('Ledger does not support eth_getEncryptionPublicKey.'))
|
||||
})
|
||||
|
||||
switch (keyring.type) {
|
||||
case 'Ledger Hardware': {
|
||||
return new Promise((_, reject) => {
|
||||
reject(
|
||||
new Error('Ledger does not support eth_getEncryptionPublicKey.'),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
case 'Trezor Hardware': {
|
||||
return new Promise((_, reject) => {
|
||||
reject(
|
||||
new Error('Trezor does not support eth_getEncryptionPublicKey.'),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
default: {
|
||||
const promise = this.encryptionPublicKeyManager.addUnapprovedMessageAsync(
|
||||
msgParams,
|
||||
req,
|
||||
)
|
||||
this.sendUpdate()
|
||||
this.opts.showUserConfirmation()
|
||||
return promise
|
||||
}
|
||||
}
|
||||
const promise = this.encryptionPublicKeyManager.addUnapprovedMessageAsync(
|
||||
msgParams,
|
||||
req,
|
||||
)
|
||||
this.sendUpdate()
|
||||
this.opts.showUserConfirmation()
|
||||
return promise
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user