*Refactor addHandler

This commit is contained in:
Derrick Hammer 2023-03-27 15:22:51 -04:00
parent b39af76606
commit 3873bd47a2
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 4 deletions

View File

@ -43,10 +43,12 @@ addHandler("ready", handleReady);
"eth_getLogs", "eth_getLogs",
"net_version", "net_version",
].forEach((rpcMethod) => { ].forEach((rpcMethod) => {
addHandler(rpcMethod, (aq: ActiveQuery) => { addHandler(rpcMethod, async (aq: ActiveQuery) => {
aq.callerInput = aq.callerInput || {}; aq.callerInput = {
aq.callerInput.method = rpcMethod; params: aq.callerInput || {},
handleRpcMethod(aq); method: rpcMethod,
};
aq.respond(await handleRpcMethod(aq));
}); });
}); });