Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `getAccounts` function is defined and used in two different places in the RPC pipeline: `RPCMethodMiddleware.ts` and `web3-provider-engine`. The second one has been removed, so now all usage is in `RPCMethodMiddleware.ts`. `getAccounts` is passed into `web3-provider-engine` and used in the `HookedWalletSubprovider`: https://github.com/MetaMask/web3-provider-engine/blob/cf612f898002833c36730d23972fe4c4dd483c76/subproviders/hooked-wallet.js It is used in these methods: * `eth_coinbase` * `eth_accounts` * `parity_defaultAccount` It's also called to validate the sender, for the following methods: * `eth_signTypedData` * `eth_signTypedData_v3` * `eth_signTypedData_v4` * `encryption_public_key` * `eth_decryptMessage` * `personal_sign` * `eth_sign` * `eth_signTransaction` * `eth_sendTransaction` Of these methods, most of them are intercepted in `RPCMethodMiddleware.ts`, so the requests never make it to `web3-provider-engine`. These three methods will make their way there: `parity_defaultAccount`, `encryption_public_key`, and `eth_decryptMessage`. The decryption- related messages rely on constructor parameters that mobile does not pass in, so those always throw an error. The only method this hook is used for in practice is `parity_defaultAccount`. The `parity_defaultAccount` method was added to `RPCMethodMiddleware.ts, so now that method won't make it to `web3-provider-engine` either. Functionally it is the same as `eth_coinbase`, so the same implementation has been used. This relates to #5513
- Loading branch information