private async Task <TransactionResourceInfo> GetResourcesForOneAsync(IChainContext chainContext,
                                                                             Transaction transaction, CancellationToken ct)
        {
            IExecutive executive = null;
            var        address   = transaction.To;

            try
            {
                executive = await _smartContractExecutiveService.GetExecutiveAsync(chainContext, address);

                if (!executive.IsParallelizable())
                {
                    return(new TransactionResourceInfo
                    {
                        TransactionId = transaction.GetHash(),
                        ParallelType = ParallelType.NonParallelizable,
                        ContractHash = executive.ContractHash
                    });
                }

                var codeRemark =
                    await _contractRemarksService.GetCodeRemarkAsync(chainContext, address,
                                                                     executive.ContractHash);

                if (codeRemark != null && codeRemark.NonParallelizable)
                {
                    return(new TransactionResourceInfo
                    {
                        TransactionId = transaction.GetHash(),
                        ParallelType = ParallelType.NonParallelizable,
                        ContractHash = executive.ContractHash,
                        IsContractRemarks = true
                    });
                }

                if (_resourceCache.TryGetValue(transaction.GetHash(), out var resourceCache) &&
                    executive.ContractHash == resourceCache.ResourceInfo.ContractHash &&
                    resourceCache.ResourceInfo.IsContractRemarks == false)
                {
                    return(resourceCache.ResourceInfo);
                }

                var resourceInfo = await executive.GetTransactionResourceInfoAsync(chainContext, transaction);

                // Try storing in cache here
                return(resourceInfo);
            }
            catch (SmartContractFindRegistrationException)
            {
                return(new TransactionResourceInfo
                {
                    TransactionId = transaction.GetHash(),
                    ParallelType = ParallelType.InvalidContractAddress
                });
            }
            finally
            {
                if (executive != null)
                {
                    await _smartContractExecutiveService.PutExecutiveAsync(address, executive);
                }
            }
        }