1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 21:00:13 +01:00
metamask-extension/app/scripts/controllers/permissions/restrictedMethods.js
Erik Marks b1d090ac4d
Add permissions controller unit tests (#7969)
* add permissions controller, log, middleware, and restricted method unit tests

* fix permissions-related bugs

* convert permissions log to controller-like class

* add permissions unit test coverage requirements

* update rpc-cap

Co-Authored-By: Whymarrh Whitby <whymarrh.whitby@gmail.com>
Co-Authored-By: Mark Stacey <markjstacey@gmail.com>
2020-03-16 10:13:22 -07:00

22 lines
504 B
JavaScript

export default function getRestrictedMethods (permissionsController) {
return {
'eth_accounts': {
description: `View the addresses of the user's chosen accounts.`,
method: (_, res, __, end) => {
permissionsController.getKeyringAccounts()
.then((accounts) => {
res.result = accounts
end()
})
.catch(
(err) => {
res.error = err
end(err)
}
)
},
},
}
}