Beispiel #1
0
        public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("Transaction(");
            bool          __first = true;

            if (__isset.id)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Id: ");
                __sb.Append(Id);
            }
            if (Source != null && __isset.source)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Source: ");
                __sb.Append(Source);
            }
            if (Target != null && __isset.target)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Target: ");
                __sb.Append(Target);
            }
            if (Amount != null && __isset.amount)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Amount: ");
                __sb.Append(Amount == null ? "<null>" : Amount.ToString());
            }
            if (Balance != null && __isset.balance)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Balance: ");
                __sb.Append(Balance == null ? "<null>" : Balance.ToString());
            }
            if (__isset.currency)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Currency: ");
                __sb.Append(Currency);
            }
            if (Signature != null && __isset.signature)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Signature: ");
                __sb.Append(Signature);
            }
            if (SmartContract != null && __isset.smartContract)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("SmartContract: ");
                __sb.Append(SmartContract == null ? "<null>" : SmartContract.ToString());
            }
            if (Fee != null && __isset.fee)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Fee: ");
                __sb.Append(Fee == null ? "<null>" : Fee.ToString());
            }
            if (__isset.timeCreation)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("TimeCreation: ");
                __sb.Append(TimeCreation);
            }
            if (UserFields != null && __isset.userFields)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("UserFields: ");
                __sb.Append(UserFields);
            }
            if (__isset.type)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Type: ");
                __sb.Append(Type);
            }
            if (SmartInfo != null && __isset.smartInfo)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("SmartInfo: ");
                __sb.Append(SmartInfo == null ? "<null>" : SmartInfo.ToString());
            }
            __sb.Append(")");
            return(__sb.ToString());
        }
Beispiel #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)
                        {
                            {
                                SmartContractsList = new List <SmartContract>();
                                TList _list29 = iprot.ReadListBegin();
                                for (int _i30 = 0; _i30 < _list29.Count; ++_i30)
                                {
                                    SmartContract _elem31;
                                    _elem31 = new SmartContract();
                                    _elem31.Read(iprot);
                                    SmartContractsList.Add(_elem31);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Beispiel #3
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("Transaction");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (__isset.id)
         {
             field.Name = "id";
             field.Type = TType.I64;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteI64(Id);
             oprot.WriteFieldEnd();
         }
         if (Source != null && __isset.source)
         {
             field.Name = "source";
             field.Type = TType.String;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteBinary(Source);
             oprot.WriteFieldEnd();
         }
         if (Target != null && __isset.target)
         {
             field.Name = "target";
             field.Type = TType.String;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteBinary(Target);
             oprot.WriteFieldEnd();
         }
         if (Amount != null && __isset.amount)
         {
             field.Name = "amount";
             field.Type = TType.Struct;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             Amount.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Balance != null && __isset.balance)
         {
             field.Name = "balance";
             field.Type = TType.Struct;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             Balance.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (__isset.currency)
         {
             field.Name = "currency";
             field.Type = TType.Byte;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             oprot.WriteByte(Currency);
             oprot.WriteFieldEnd();
         }
         if (Signature != null && __isset.signature)
         {
             field.Name = "signature";
             field.Type = TType.String;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             oprot.WriteBinary(Signature);
             oprot.WriteFieldEnd();
         }
         if (SmartContract != null && __isset.smartContract)
         {
             field.Name = "smartContract";
             field.Type = TType.Struct;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             SmartContract.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Fee != null && __isset.fee)
         {
             field.Name = "fee";
             field.Type = TType.Struct;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             Fee.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (__isset.timeCreation)
         {
             field.Name = "timeCreation";
             field.Type = TType.I64;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             oprot.WriteI64(TimeCreation);
             oprot.WriteFieldEnd();
         }
         if (UserFields != null && __isset.userFields)
         {
             field.Name = "userFields";
             field.Type = TType.String;
             field.ID   = 11;
             oprot.WriteFieldBegin(field);
             oprot.WriteBinary(UserFields);
             oprot.WriteFieldEnd();
         }
         if (__isset.type)
         {
             field.Name = "type";
             field.Type = TType.I32;
             field.ID   = 12;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32((int)Type);
             oprot.WriteFieldEnd();
         }
         if (SmartInfo != null && __isset.smartInfo)
         {
             field.Name = "smartInfo";
             field.Type = TType.Struct;
             field.ID   = 13;
             oprot.WriteFieldBegin(field);
             SmartInfo.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }