Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
205db8f
feat: use metamask ethJsonRpcMiddleware
MarioAslau Jun 10, 2024
d927d34
fix(deps): [email protected] -> @metamask/eth-json-rpc-filte…
legobeat Apr 16, 2024
4d2c65f
deps: json-rpc-engine@^6.1.0 -> @metamask/json-rpc-engine@^7.1.0
legobeat Apr 17, 2024
63d560a
Update JsonRpcRequest typings
legobeat Apr 17, 2024
fbd8509
chainId is now hex string, not number
legobeat Apr 18, 2024
f1e0653
chore(test): eth_sendTransaction test type workarounds
legobeat May 20, 2024
e4e7599
fixup: console.error in test
legobeat May 20, 2024
4a914af
fix(test): test for error cause message in RPCMethodMIddleware
legobeat May 20, 2024
e1d2a04
chore: update test
legobeat Jun 11, 2024
0c1a8a1
chore: wip: add @ts-expect-error directive
legobeat Jun 11, 2024
69a39cc
Merge branch 'feat/eth-json-rpc' into json-rpc-middleware-12
legobeat Jun 11, 2024
e160aa5
chore: update .iyarc
legobeat Jun 11, 2024
98fba92
Merge branch 'main' into json-rpc-middleware-12
tommasini Jun 11, 2024
242934d
feat: downgrade from 12 to 11
MarioAslau Jun 11, 2024
6cfbed3
Merge branch 'main' into json-rpc-middleware-12
MarioAslau Jun 11, 2024
dfae3be
Merge branch 'main' into json-rpc-middleware-12
MarioAslau Jun 20, 2024
1342855
middleware to latest version
tommasini Jun 24, 2024
cd52169
merge main and solve conflicts
tommasini Jun 24, 2024
c6e47ed
background bridge cleanup fix, bump json rpc engine to latest version
tommasini Jun 24, 2024
eb65e5c
fix depcheck issues
tommasini Jun 24, 2024
ff9d996
fix lint issues
tommasini Jun 24, 2024
6031165
fix lint and fix ts error
tommasini Jun 24, 2024
119c662
dedupe
tommasini Jun 24, 2024
ddfb55d
received always the Internal JSON-RPC error. error message
tommasini Jun 24, 2024
49cf6fa
Merge branch 'main' into chore/provider-middleware-filters
legobeat Jun 25, 2024
010a194
Merge branch 'main' into chore/provider-middleware-filters
legobeat Jun 25, 2024
306f90e
fix on snap bridge
tommasini Jun 25, 2024
a98f7d3
feat: update createLegacyMethodMiddleware tests
MarioAslau Jun 25, 2024
b7b8f28
feat: remove type
MarioAslau Jun 25, 2024
def0c9d
feat: removed unused imports
MarioAslau Jun 25, 2024
21b26c3
Revert "feat: removed unused imports"
MarioAslau Jun 25, 2024
6c61321
feat: removed unused imports
MarioAslau Jun 25, 2024
0debc05
Merge branch 'main' into chore/provider-middleware-filters
tommasini Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint issues
  • Loading branch information
tommasini committed Jun 24, 2024
commit ff9d9961b1c71337555aef5c11dfcf7e70a5315c
1 change: 0 additions & 1 deletion app/core/RPCMethods/RPCMethodMiddleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ describe('getRpcMethodMiddleware', () => {
permissionController.createPermissionMiddleware({
origin: hostMock,
});
// @ts-expect-error TODO
engine.push(permissionMiddleware);
const middleware = getRpcMethodMiddleware(getMinimalOptions());
engine.push(middleware);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { rpcErrors } from '@metamask/rpc-errors';
import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';

import { UNSUPPORTED_RPC_METHODS } from '../utils';
import { Json, JsonRpcParams } from '@metamask/utils';

/**
* Creates a middleware that rejects explicitly unsupported RPC methods with the
* appropriate error.
*/
const createUnsupportedMethodMiddleware = (): JsonRpcMiddleware<
unknown,
void
JsonRpcParams,
Json
> =>
async function unsupportedMethodMiddleware(req, _res, next, end) {
if ((UNSUPPORTED_RPC_METHODS as Set<string>).has(req.method)) {
Expand Down
3 changes: 1 addition & 2 deletions app/core/RPCMethods/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function makeMethodMiddlewareMaker<U>(
const makeMethodMiddleware = (hooks: Record<string, unknown>) => {
assertExpectedHook(hooks, expectedHookNames);

const methodMiddleware: JsonRpcMiddleware<JsonRpcParams, unknown> = async (
const methodMiddleware: JsonRpcMiddleware<JsonRpcParams, Json> = async (
req,
res,
next,
Expand All @@ -88,7 +88,6 @@ export function makeMethodMiddlewareMaker<U>(
try {
// Implementations may or may not be async, so we must await them.
return await implementation(
// @ts-expect-error JsonRpcId (number | string | void) doesn't match the permission middleware's id, which is (string | number | null)
req,
res,
next,
Expand Down