Exemplo n.º 1
0
 public PeriodData(NodeApi.PeriodStats stat)
 {
     AllLedgers      = new StatItem(stat.PoolsCount);
     AllTransactions = new StatItem(stat.TransactionsCount);
     if (stat.BalancePerCurrency.ContainsKey("cs"))
     {
         CSVolume = new StatItem(stat.BalancePerCurrency["cs"].Integral);
     }
     else if (stat.BalancePerCurrency.ContainsKey("CS"))
     {
         CSVolume = new StatItem(stat.BalancePerCurrency["CS"].Integral);
     }
     SmartContracts = new StatItem(stat.SmartContractsCount);
     Period         = stat.PeriodDuration;
 }
Exemplo n.º 2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.Struct)
                        {
                            Status = new APIResponse();
                            Status.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                Stats = new List <PeriodStats>();
                                TList _list33 = iprot.ReadListBegin();
                                for (int _i34 = 0; _i34 < _list33.Count; ++_i34)
                                {
                                    PeriodStats _elem35;
                                    _elem35 = new PeriodStats();
                                    _elem35.Read(iprot);
                                    Stats.Add(_elem35);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }