Esempio n. 1
0
        public static string[] GetAllRelatedAddresses(this Transaction tx, TransactionReceipt receipt)
        {
            if (tx == null)
            {
                return(Array.Empty <string>());
            }

            var uniqueAddresses = new UniqueAddressList()
            {
                tx.From
            };

            if (tx.To.IsNotAnEmptyAddress())
            {
                uniqueAddresses.Add(tx.To);
            }

            if (receipt != null)
            {
                if (receipt.ContractAddress.IsNotAnEmptyAddress())
                {
                    uniqueAddresses.Add(receipt.ContractAddress);
                }

                foreach (var log in tx.GetTransactionLogs(receipt))
                {
                    if (log.Address.IsNotAnEmptyAddress())
                    {
                        uniqueAddresses.Add(log.Address);
                    }
                }
            }

            return(uniqueAddresses.ToArray());
        }
Esempio n. 2
0
 public Task HandleAsync(ContractTransaction contractTransaction)
 {
     ContractAddresses.Add(contractTransaction.ContractAddress);
     return(Task.CompletedTask);
 }