//public async Task UpsertAsync(Nethereum.RPC.Eth.DTOs.Transaction transaction,
        //    TransactionReceipt transactionReceipt,
        //    bool failedCreatingContract,
        //    HexBigInteger blockTimestamp,
        //    string address,
        //    string error = null,
        //    bool hasVmStack = false,
        //    string newContractAddress = null)
        //{
        //  var entity = AddressTransaction.CreateAddressTransaction(transaction,
        //      transactionReceipt,
        //      failedCreatingContract, blockTimestamp, null, null, false, newContractAddress);
        //  await InsertOrUpdate(entity);
        //}

        public async Task InsertOrUpdate(AddressTransaction addr)
        {
            using (var context = new BlockchainStoreContext())
            {
                //context.Entry(addr).State = string.IsNullOrEmpty(addr.Address) ?
                //                           EntityState.Added :
                //                           EntityState.Modified;
                try
                {
                    context.AddressTransactions.Add(addr);
                    await context.SaveChangesAsync();
                }
                catch (System.Exception)
                {
                }
            }
        }
        public static AddressTransaction CreateAddressTransaction(RPC.Eth.DTOs.Transaction transactionSource,
                                                                  TransactionReceipt transactionReceipt,
                                                                  bool failed,
                                                                  HexBigInteger timeStamp,
                                                                  string address,
                                                                  string error              = null,
                                                                  bool hasVmStack           = false,
                                                                  string newContractAddress = null
                                                                  )
        {
            var transaction = new AddressTransaction()
            {
                Address = address ?? string.Empty
            };

            //transaction.SetRowKey(transactionSource.BlockNumber, transactionSource.TransactionHash);
            return
                ((AddressTransaction)
                 CreateTransaction(transaction, transactionSource, transactionReceipt, failed, timeStamp, error,
                                   hasVmStack, newContractAddress));
        }