private void ListViewContracts_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (this.ListViewContracts.SelectedItem != null) { this.m_ContainerCollection.Clear(); Business.EthContract ethContract = (Business.EthContract) this.ListViewContracts.SelectedItem; int containerCount = this.m_GethAPI.GetContainerCount(ethContract.ContractAddress); for (int i = 0; i < containerCount; i++) { string result = this.m_GethAPI.GetContainer(ethContract.ContractAddress, i); Business.Specimen.Model.Container container = new Business.Specimen.Model.Container(result); this.m_ContainerCollection.Add(container); } } }
private void LoopTheChain() { Business.EthBlock latestBlock = this.m_GethAPI.GetLatestBlock(); int startingBlockNumber = this.GetFirstBlockNumberForDate(DateTime.Today.AddDays(-2)); for (int i = startingBlockNumber; i < latestBlock.Number; i++) { int transactionCount = this.m_GethAPI.GetBlockTransactionCountByNumber(i); if (transactionCount > 0) { Business.EthBlock block = this.m_GethAPI.GetBlockByNumber(i); foreach (string transactionHash in block.TransactionHashes) { string contractAddress = this.m_GethAPI.GetContractAddress(transactionHash); if (string.IsNullOrEmpty(contractAddress) == false) { int containerCount = this.m_GethAPI.GetContainerCount(contractAddress); Business.EthContract contract = new Business.EthContract(contractAddress, containerCount, block.TimeStamp); this.m_ContractCollection.Add(contract); } } } } }