Beispiel #1
0
        public async Task <ContractAddress> QueryReceipt(string certId, Guid orgId, string txId, int waitBeforeEachQuery = 1000)
        {
            TransactionReceipt            receipt  = default(TransactionReceipt);
            CertificationRegistryContract contract = new CertificationRegistryContract(_web3, EthConnectionData.mastercontractaddr);

            while (true)
            {
                receipt = await _web3.Eth.Transactions.GetTransactionReceipt
                          .SendRequestAsync(txId);

                var logs = receipt?.Logs;

                if (receipt != null)
                {
                    //todo ask henry chuong about orgId on blockchain
                    var certAddress = await contract.GetCertAddressByIdAsync(certId, orgId.ToString("N"));

                    return(new ContractAddress(certId, certAddress));
                }
                else
                {
                    await Task.Delay(waitBeforeEachQuery);
                }
            }
        }
        public async Task <ContractAddress> QuerryReceipt(string certId, string orgId, string txId, int waitBeforeEachQuerry = 1000)
        {
            TransactionReceipt            receipt  = default(TransactionReceipt);
            CertificationRegistryContract contract = new CertificationRegistryContract(web3, mastercontractaddr);

            while (true)
            {
                receipt = await web3.Eth.Transactions.GetTransactionReceipt
                          .SendRequestAsync(txId);

                var logs = receipt?.Logs;

                if (receipt != null)
                {
                    var certAddress = await contract.GetCertAddressByIdAsync(certId, orgId);

                    return(new ContractAddress(certId, certAddress));
                }
                else
                {
                    await Task.Delay(waitBeforeEachQuerry);
                }
            }
        }