Esempio n. 1
0
        private async Task <JsonRpcResponse> ExecuteRequestAsync(JsonRpcRequest rpcRequest, JsonRpcContext context)
        {
            string methodName = rpcRequest.Method.Trim();

            (MethodInfo MethodInfo, bool ReadOnly)result = _rpcModuleProvider.Resolve(methodName);
            return(result.MethodInfo != null
                ? await ExecuteAsync(rpcRequest, methodName, result, context)
                : GetErrorResponse(methodName, ErrorCodes.MethodNotFound, "Method not found", $"{rpcRequest.Method}", rpcRequest.Id));
        }
Esempio n. 2
0
        private async Task <JsonRpcResponse> ExecuteRequestAsync(JsonRpcRequest rpcRequest)
        {
            var methodName = rpcRequest.Method.Trim().ToLower();

            var result = _rpcModuleProvider.Resolve(methodName);

            if (result.MethodInfo != null)
            {
                return(await ExecuteAsync(rpcRequest, methodName, result));
            }

            return(GetErrorResponse(ErrorType.MethodNotFound, $"Method {rpcRequest.Method} is not supported", rpcRequest.Id, methodName));
        }