public void Proof_module_is_not_registered_when_json_rpc_not_enabled()
        {
            JsonRpcConfig jsonRpcConfig = new JsonRpcConfig();

            jsonRpcConfig.Enabled = false;

            IConfigProvider configProvider = Substitute.For <IConfigProvider>();

            configProvider.GetConfig <IJsonRpcConfig>().Returns(jsonRpcConfig);

            IRpcModuleProvider rpcModuleProvider = Substitute.For <IRpcModuleProvider>();

            NethermindApi context = new NethermindApi(configProvider, LimboLogs.Instance)
            {
                ConfigProvider    = configProvider,
                RpcModuleProvider = rpcModuleProvider,
                TxPool            = Substitute.For <ITxPool>(),
                BlockTree         = Substitute.For <IBlockTree>(),
                Wallet            = Substitute.For <IWallet>(),
                SpecProvider      = Substitute.For <ISpecProvider>(),
                TxSender          = Substitute.For <ITxSender>()
            };

            RegisterRpcModules registerRpcModules = new RegisterRpcModules(context);

            registerRpcModules.Execute(CancellationToken.None);

            rpcModuleProvider.DidNotReceiveWithAnyArgs().Register <IProofModule>(null);
        }
Beispiel #2
0
        public void Proof_module_is_not_registered_when_json_rpc_not_enabled()
        {
            JsonRpcConfig jsonRpcConfig = new JsonRpcConfig();

            jsonRpcConfig.Enabled = false;

            IConfigProvider configProvider = Substitute.For <IConfigProvider>();

            configProvider.GetConfig <IJsonRpcConfig>().Returns(jsonRpcConfig);

            IRpcModuleProvider rpcModuleProvider = Substitute.For <IRpcModuleProvider>();

            EthereumRunnerContext context = new EthereumRunnerContext(configProvider, LimboLogs.Instance);

            context.ConfigProvider    = configProvider;
            context.RpcModuleProvider = rpcModuleProvider;

            RegisterRpcModules registerRpcModules = new RegisterRpcModules(context);

            registerRpcModules.Execute();

            rpcModuleProvider.DidNotReceiveWithAnyArgs().Register <IProofModule>(null);
        }