Beispiel #1
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();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
Beispiel #2
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("Transaction");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (InnerId != null && __isset.innerId)
         {
             field.Name = "innerId";
             field.Type = TType.String;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(InnerId);
             oprot.WriteFieldEnd();
         }
         if (Source != null && __isset.source)
         {
             field.Name = "source";
             field.Type = TType.String;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Source);
             oprot.WriteFieldEnd();
         }
         if (Target != null && __isset.target)
         {
             field.Name = "target";
             field.Type = TType.String;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(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 (Currency != null && __isset.currency)
         {
             field.Name = "currency";
             field.Type = TType.String;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Currency);
             oprot.WriteFieldEnd();
         }
         if (SmartContract != null && __isset.smartContract)
         {
             field.Name = "smartContract";
             field.Type = TType.Struct;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             SmartContract.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }