*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",
"net_version",
].forEach((rpcMethod) => {
addHandler(rpcMethod, (aq: ActiveQuery) => {
aq.callerInput = aq.callerInput || {};
aq.callerInput.method = rpcMethod;
handleRpcMethod(aq);
addHandler(rpcMethod, async (aq: ActiveQuery) => {
aq.callerInput = {
params: aq.callerInput || {},
method: rpcMethod,
};
aq.respond(await handleRpcMethod(aq));
});
});