Esempio n. 1
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);
        }
        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);
            }
        }