MCPcopy Create free account
hub / github.com/Web3Auth/Auth / makeEngine

Function makeEngine

test/v2/jrpcServer.test.ts:13–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11const jsonrpc = "2.0" as const;
12
13const makeEngine = (): JRPCEngineV2 => {
14 return JRPCEngineV2.create<JRPCMiddlewareV2>({
15 middleware: [
16 ({ request }): Json | undefined => {
17 if (request.method !== "hello") {
18 throw new Error("Unknown method");
19 }
20 return isRequest(request) ? ((request.params as Json) ?? null) : undefined;
21 },
22 ],
23 });
24};
25
26describe("JsonRpcServer", () => {
27 it("can be constructed with an engine", () => {

Callers 1

jrpcServer.test.tsFile · 0.85

Calls 2

isRequestFunction · 0.90
createMethod · 0.80

Tested by

no test coverage detected