Skip to content

Commit

Permalink
Refactor static method middlware (#5621)
Browse files Browse the repository at this point in the history
Some RPC methods that return static results are being handled in
`web3-provider-engine` rather than `RPCMethodMiddleware.ts`. They have
now all been moved to `RPCMethodMiddleware.ts`.

This should result in no functional changes.

This relates to #5513
  • Loading branch information
Gudahtt authored Feb 3, 2023
1 parent 96466ad commit 6e062b6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/core/RPCMethods/RPCMethodMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ export const getRpcMethodMiddleware = ({
res.result = `0x${parseInt(chainId, 10).toString(16)}`;
}
},
eth_hashrate: () => {
res.result = '0x00';
},
eth_mining: () => {
res.result = false;
},
net_listening: () => {
res.result = true;
},
net_version: async () => {
const {
provider: { type: networkType },
Expand Down

0 comments on commit 6e062b6

Please sign in to comment.