mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
05fae3fa1e
Adds a property, `hookNames`, to each RPC method handler export in `app/scripts/lib/rpc-method-middleware` and a function, `selectHooks`, to select from them. `createMethodMiddleware` receives a giant `opts` object that includes a bunch of different methods from `MetaMaskController` and its subcontrollers. Each method implementation only requires a subset of these methods to do its work. Because they need some kind of name, we call these methods "hooks". With this change, whenever an RPC method is called, `selectHooks` will be called to ensure that each method only receives the hooks that it needs in order to do its job. This implementation is based on [work in `snaps-skunkworks`](https://github.com/MetaMask/snaps-skunkworks/blob/a3e1248/packages/rpc-methods/src/utils.ts#L17-L34) that will be merged in the near future. |
||
---|---|---|
.. | ||
ens-ipfs | ||
migrator | ||
rpc-method-middleware | ||
account-tracker.js | ||
buy-eth-url.js | ||
buy-eth-url.test.js | ||
cleanErrorStack.js | ||
cleanErrorStack.test.js | ||
ComposableObservableStore.js | ||
ComposableObservableStore.test.js | ||
createLoggerMiddleware.js | ||
createMetaRPCHandler.js | ||
createMetaRPCHandler.test.js | ||
createOnboardingMiddleware.js | ||
createOriginMiddleware.js | ||
createStreamSink.js | ||
createTabIdMiddleware.js | ||
decrypt-message-manager.js | ||
encryption-public-key-manager.js | ||
extractEthjsErrorMessage.js | ||
get-first-preferred-lang-code.js | ||
getObjStructure.js | ||
local-store.js | ||
message-manager.js | ||
message-manager.test.js | ||
metaRPCClientFactory.js | ||
metaRPCClientFactory.test.js | ||
network-store.js | ||
nodeify.js | ||
nodeify.test.js | ||
notification-manager.js | ||
personal-message-manager.js | ||
personal-message-manager.test.js | ||
seed-phrase-verifier.js | ||
seed-phrase-verifier.test.js | ||
segment.js | ||
setupSentry.js | ||
stream-utils.js | ||
typed-message-manager.js | ||
typed-message-manager.test.js | ||
util.js | ||
util.test.js |