示例#1
0
        public ContractTask(Oracle oracle)
        {
            calculator = new Calculator(oracle.web3);

            var summa = Summa.Create();

            calculator.RequestToConvetSumma(summa.rubs, summa.kops);
            calculator.AskRateFrom(oracle);

            id = count++;
        }
示例#2
0
        public void ExecuteWith(Oracle oracle)
        {
            oracle.RequestToExecute(calculator);

            var res  = calculator.Result();
            var rate = calculator.Rate();

            string info = $"Contract address {calculator.Address()} from thread # {Thread.CurrentThread.ManagedThreadId}: {res} with rate {rate}";

            Log.Information(info);
            Console.WriteLine(info);
        }
示例#3
0
 public void AskRateFrom(Oracle oracle)
 {
     oracle.RequestToSetRate();
     var r = service.AskRateFromOracleRequestAndWaitForReceiptAsync(oracle.Address()).Result;
 }