예제 #1
0
 private JsonRpcResponse TestRequest<T>(T module, string method, params string[] parameters) where T : IRpcModule
 {
     RpcModuleProvider moduleProvider = new RpcModuleProvider(new FileSystem(), _configurationProvider.GetConfig<IJsonRpcConfig>(), LimboLogs.Instance);
     moduleProvider.Register(new SingletonModulePool<T>(new SingletonFactory<T>(module), true));
     _jsonRpcService = new JsonRpcService(moduleProvider, _logManager);
     JsonRpcRequest request = RpcTest.GetJsonRequest(method, parameters);
     JsonRpcResponse response = _jsonRpcService.SendRequestAsync(request, JsonRpcContext.Http).Result;
     Assert.AreEqual(request.Id, response.Id);
     return response;
 }
        private JsonRpcResponse TestRequest <T>(IModule ethModule, string method, params string[] parameters) where T : IModule
        {
            RpcModuleProvider moduleProvider = new RpcModuleProvider(_configurationProvider.GetConfig <IJsonRpcConfig>());

            moduleProvider.Register <T>(ethModule);
            _jsonRpcService = new JsonRpcService(moduleProvider, _logManager);
            JsonRpcRequest  request  = RpcTest.GetJsonRequest(method, parameters);
            JsonRpcResponse response = _jsonRpcService.SendRequestAsync(request).Result;

            Assert.AreEqual(request.Id, response.Id);
            return(response);
        }