Пример #1
0
        private static void ExecuteRpcTask(RpcAPI performance, bool autoTest = false)
        {
            Logger.WriteInfo("Select execution type:");
            Console.WriteLine("1. Normal mode");
            Console.WriteLine("2. Continus Tx mode");
            Console.WriteLine("3. Batch mode");
            Console.WriteLine("4. Continus Txs mode");
            Console.Write("Input selection: ");

            int result = 0;

            if (autoTest)
            {
                result = 3;
            }
            else
            {
                string runType = Console.ReadLine();
                bool   check   = Int32.TryParse(runType, out result);
                if (!check)
                {
                    Logger.WriteInfo("Wrong input, please input again.");
                    ExecuteRpcTask(performance);
                }
            }

            switch (result)
            {
            case 1:
                performance.ExecuteContracts();
                break;

            case 2:
                performance.ExecuteMultiRpcTask();
                break;

            case 3:
                performance.ExecuteContractsRpc();
                break;

            case 4:
                performance.ExecuteMultiRpcTask(useTxs: true);
                break;

            default:
                Logger.WriteInfo("Wrong input, please input again.");
                ExecuteRpcTask(performance);
                break;
            }

            performance.PrintContractInfo();
        }
Пример #2
0
        private static void ExecuteRpcTask(RpcAPI performance)
        {
            Console.WriteLine("Select execution type:");
            Console.WriteLine("1. Normal mode");
            Console.WriteLine("2. Avage mode");
            Console.WriteLine("3. Batch mode");
            Console.Write("Input selection: ");
            string runType = Console.ReadLine();
            int    result  = 0;
            bool   check   = Int32.TryParse(runType, out result);

            if (!check)
            {
                Console.WriteLine("Wrong input, please input again.");
                ExecuteRpcTask(performance);
            }

            switch (result)
            {
            case 1:
                performance.ExecuteContracts();
                break;

            case 2:
                performance.ExecuteMultiTask();
                break;

            case 3:
                performance.ExecuteContractsRpc();
                break;

            default:
                Console.WriteLine("Wrong input, please input again.");
                ExecuteRpcTask(performance);
                break;
            }
            performance.PrintContractInfo();
        }