Exemple #1
0
        public Task <(Transaction tx, RpcApplicationLog?appLog)> GetTransactionAsync(UInt256 txHash)
        {
            try
            {
                if (disposedValue)
                {
                    return(Task.FromException <(Transaction, RpcApplicationLog?)>(new ObjectDisposedException(nameof(OfflineNode))));
                }

                var tx = NativeContract.Ledger.GetTransaction(neoSystem.StoreView, txHash);
                if (tx == null)
                {
                    return(Task.FromException <(Transaction, RpcApplicationLog?)>(new Exception("Unknown Transaction")));
                }

                var jsonLog = ExpressAppLogsPlugin.GetAppLog(rocksDbStorageProvider, txHash);
                var result  = jsonLog != null
                    ? (tx, RpcApplicationLog.FromJson(jsonLog, ProtocolSettings))
                    : (tx, null);

                return(Task.FromResult(result));
            }
            catch (Exception ex)
            {
                return(Task.FromException <(Transaction, RpcApplicationLog?)>(ex));
            }
        }
Exemple #2
0
        public JObject GetApplicationLog(JArray _params)
        {
            UInt256 hash = UInt256.Parse(_params[0].AsString());

            return(ExpressAppLogsPlugin.GetAppLog(storageProvider, hash) ?? throw new RpcException(-100, "Unknown transaction"));
        }