コード例 #1
0
        public IEnumerator PollForReceipt(string transactionHash, float secondsToWait)
        {
            TransactionReceipt receipt = null;

            Result = null;
            while (receipt == null)
            {
                if (!CancelPolling)
                {
                    yield return(_ethGetTransactionReceipt.SendRequest(transactionHash));

                    if (_ethGetTransactionReceipt.Exception == null)
                    {
                        receipt = _ethGetTransactionReceipt.Result;
                    }
                    else
                    {
                        this.Exception = _ethGetTransactionReceipt.Exception;
                        yield break;
                    }
                }
                else
                {
                    yield break;
                }

                yield return(new WaitForSeconds(secondsToWait));
            }

            Result = receipt;
        }
コード例 #2
0
        public IEnumerator PollForReceipt(string transactionHash, float secondsToWait)
        {
            if (string.IsNullOrEmpty(transactionHash))
            {
                yield break;
            }

            WaitForSeconds     waiter  = new WaitForSeconds(secondsToWait);
            TransactionReceipt receipt = null;

            Result = null;

            while (receipt == null)
            {
                yield return(_ethGetTransactionReceipt.SendRequest(transactionHash));

                if (_ethGetTransactionReceipt.Exception == null)
                {
                    receipt = _ethGetTransactionReceipt.Result;
                }
                else
                {
                    Exception = _ethGetTransactionReceipt.Exception;
                    yield break;
                }

                yield return(waiter);
            }

            Result = receipt;
        }