Ejemplo n.º 1
0
        public static void Encode(IByteWriter stream, AccountEntry encodedAccountEntry)
        {
            AccountID.Encode(stream, encodedAccountEntry.AccountID);
            Int64.Encode(stream, encodedAccountEntry.Balance);
            SequenceNumber.Encode(stream, encodedAccountEntry.SeqNum);
            Uint32.Encode(stream, encodedAccountEntry.NumSubEntries);
            if (encodedAccountEntry.InflationDest != null)
            {
                XdrEncoding.EncodeInt32(1, stream);
                AccountID.Encode(stream, encodedAccountEntry.InflationDest);
            }
            else
            {
                XdrEncoding.EncodeInt32(0, stream);
            }
            Uint32.Encode(stream, encodedAccountEntry.Flags);
            String32.Encode(stream, encodedAccountEntry.HomeDomain);
            Thresholds.Encode(stream, encodedAccountEntry.Thresholds);
            int signerssize = encodedAccountEntry.Signers.Length;

            XdrEncoding.EncodeInt32(signerssize, stream);
            for (int i = 0; i < signerssize; i++)
            {
                Signer.Encode(stream, encodedAccountEntry.Signers[i]);
            }
            AccountEntryExt.Encode(stream, encodedAccountEntry.Ext);
        }
Ejemplo n.º 2
0
        public static void Encode(XdrDataOutputStream stream, AccountEntry encodedAccountEntry)
        {
            AccountID.Encode(stream, encodedAccountEntry.AccountID);
            Int64.Encode(stream, encodedAccountEntry.Balance);
            SequenceNumber.Encode(stream, encodedAccountEntry.SeqNum);
            Uint32.Encode(stream, encodedAccountEntry.NumSubEntries);

            if (encodedAccountEntry.InflationDest != null)
            {
                stream.WriteInt(1);
                AccountID.Encode(stream, encodedAccountEntry.InflationDest);
            }
            else
            {
                stream.WriteInt(0);
            }

            Uint32.Encode(stream, encodedAccountEntry.Flags);
            String32.Encode(stream, encodedAccountEntry.HomeDomain);
            Thresholds.Encode(stream, encodedAccountEntry.Thresholds);
            int signerssize = encodedAccountEntry.Signers.Length;

            stream.WriteInt(signerssize);

            for (int i = 0; i < signerssize; i++)
            {
                Signer.Encode(stream, encodedAccountEntry.Signers[i]);
            }

            AccountEntryExt.Encode(stream, encodedAccountEntry.Ext);
        }
Ejemplo n.º 3
0
 public static void Encode(IByteWriter stream, SetOptionsOp encodedSetOptionsOp)
 {
     if (encodedSetOptionsOp.InflationDest != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         AccountID.Encode(stream, encodedSetOptionsOp.InflationDest);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
     if (encodedSetOptionsOp.ClearFlags != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         Uint32.Encode(stream, encodedSetOptionsOp.ClearFlags);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
     if (encodedSetOptionsOp.SetFlags != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         Uint32.Encode(stream, encodedSetOptionsOp.SetFlags);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
     if (encodedSetOptionsOp.MasterWeight != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         Uint32.Encode(stream, encodedSetOptionsOp.MasterWeight);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
     if (encodedSetOptionsOp.LowThreshold != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         Uint32.Encode(stream, encodedSetOptionsOp.LowThreshold);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
     if (encodedSetOptionsOp.MedThreshold != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         Uint32.Encode(stream, encodedSetOptionsOp.MedThreshold);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
     if (encodedSetOptionsOp.HighThreshold != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         Uint32.Encode(stream, encodedSetOptionsOp.HighThreshold);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
     if (encodedSetOptionsOp.HomeDomain != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         String32.Encode(stream, encodedSetOptionsOp.HomeDomain);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
     if (encodedSetOptionsOp.Signer != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         Signer.Encode(stream, encodedSetOptionsOp.Signer);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
 }
Ejemplo n.º 4
0
 public static void Encode(XdrDataOutputStream stream, SetOptionsOp encodedSetOptionsOp)
 {
     if (encodedSetOptionsOp.InflationDest != null)
     {
         stream.WriteInt(1);
         AccountID.Encode(stream, encodedSetOptionsOp.InflationDest);
     }
     else
     {
         stream.WriteInt(0);
     }
     if (encodedSetOptionsOp.ClearFlags != null)
     {
         stream.WriteInt(1);
         Uint32.Encode(stream, encodedSetOptionsOp.ClearFlags);
     }
     else
     {
         stream.WriteInt(0);
     }
     if (encodedSetOptionsOp.SetFlags != null)
     {
         stream.WriteInt(1);
         Uint32.Encode(stream, encodedSetOptionsOp.SetFlags);
     }
     else
     {
         stream.WriteInt(0);
     }
     if (encodedSetOptionsOp.MasterWeight != null)
     {
         stream.WriteInt(1);
         Uint32.Encode(stream, encodedSetOptionsOp.MasterWeight);
     }
     else
     {
         stream.WriteInt(0);
     }
     if (encodedSetOptionsOp.LowThreshold != null)
     {
         stream.WriteInt(1);
         Uint32.Encode(stream, encodedSetOptionsOp.LowThreshold);
     }
     else
     {
         stream.WriteInt(0);
     }
     if (encodedSetOptionsOp.MedThreshold != null)
     {
         stream.WriteInt(1);
         Uint32.Encode(stream, encodedSetOptionsOp.MedThreshold);
     }
     else
     {
         stream.WriteInt(0);
     }
     if (encodedSetOptionsOp.HighThreshold != null)
     {
         stream.WriteInt(1);
         Uint32.Encode(stream, encodedSetOptionsOp.HighThreshold);
     }
     else
     {
         stream.WriteInt(0);
     }
     if (encodedSetOptionsOp.HomeDomain != null)
     {
         stream.WriteInt(1);
         String32.Encode(stream, encodedSetOptionsOp.HomeDomain);
     }
     else
     {
         stream.WriteInt(0);
     }
     if (encodedSetOptionsOp.Signer != null)
     {
         stream.WriteInt(1);
         Signer.Encode(stream, encodedSetOptionsOp.Signer);
     }
     else
     {
         stream.WriteInt(0);
     }
 }