Exemple #1
0
        public async Task GetTxOutSetInfo()
        {
            // Server Test
            UTXO       utxo = new UTXO();
            TxOutSetOM om   = await utxo.GetTxOutSetInfo();

            Assert.IsNotNull(om);
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static async Task <ApiResponse> GetTxOutSetInfo()
        {
            ApiResponse response = new ApiResponse();

            try
            {
                UTXO     utxo = new UTXO();
                TxOutSet set  = new TxOutSet();

                TxOutSetOM result = await utxo.GetTxOutSetInfo();

                if (result != null)
                {
                    set.BestBlock    = result.BestBlock;
                    set.Height       = result.Height;
                    set.Total_amount = result.Total_amount;
                    set.Transactions = result.Transactions;
                    set.Txouts       = result.Txouts;
                    response.Result  = Newtonsoft.Json.Linq.JToken.FromObject(set);
                }
                else
                {
                    response.Result = null;
                }
            }
            catch (ApiCustomException ex)
            {
                Logger.Singleton.Error(ex.ToString());
                response.Error = new ApiError(ex.ErrorCode, ex.ToString());
            }
            catch (Exception ex)
            {
                Logger.Singleton.Error(ex.ToString());
                response.Error = new ApiError(ex.HResult, ex.ToString());
            }
            return(response);
        }