*Set context to RpcContext and ass type asserts

This commit is contained in:
Derrick Hammer 2022-08-05 00:01:03 -04:00
parent c95917f789
commit 1fd1c932ca
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 3 deletions

View File

@ -42,16 +42,16 @@ export function proxyRpcMethod(
method: string,
chains: string[] = []
): Function {
return async function (args: any, context: object) {
return async function (args: any, context: RpcContext) {
// @ts-ignore
let chain = context.chain;
let chainId = maybeMapChainId(chain);
let chainId = maybeMapChainId(chain as string);
let chainMatch = true;
if (
chains.length > 0 &&
!chains.includes(chain) &&
!chains.includes(chain as string) &&
!chains.includes(chainId.toString())
) {
chainMatch = false;