Beispiel #1
0
        public static AccountEntry Decode(IByteReader stream)
        {
            AccountEntry decodedAccountEntry = new AccountEntry();

            decodedAccountEntry.AccountID     = AccountID.Decode(stream);
            decodedAccountEntry.Balance       = Int64.Decode(stream);
            decodedAccountEntry.SeqNum        = SequenceNumber.Decode(stream);
            decodedAccountEntry.NumSubEntries = Uint32.Decode(stream);
            int inflationDestPresent = XdrEncoding.DecodeInt32(stream);

            if (inflationDestPresent != 0)
            {
                decodedAccountEntry.InflationDest = AccountID.Decode(stream);
            }
            decodedAccountEntry.Flags      = Uint32.Decode(stream);
            decodedAccountEntry.HomeDomain = String32.Decode(stream);
            decodedAccountEntry.Thresholds = Thresholds.Decode(stream);
            int signerssize = XdrEncoding.DecodeInt32(stream);

            decodedAccountEntry.Signers = new Signer[signerssize];
            for (int i = 0; i < signerssize; i++)
            {
                decodedAccountEntry.Signers[i] = Signer.Decode(stream);
            }
            decodedAccountEntry.Ext = AccountEntryExt.Decode(stream);
            return(decodedAccountEntry);
        }
        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);
        }
Beispiel #3
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);
        }
Beispiel #4
0
        public static AccountEntry Decode(XdrDataInputStream stream)
        {
            var decodedAccountEntry = new AccountEntry();

            decodedAccountEntry.AccountID     = AccountID.Decode(stream);
            decodedAccountEntry.Balance       = Int64.Decode(stream);
            decodedAccountEntry.SeqNum        = SequenceNumber.Decode(stream);
            decodedAccountEntry.NumSubEntries = Uint32.Decode(stream);
            var InflationDestPresent = stream.ReadInt();

            if (InflationDestPresent != 0)
            {
                decodedAccountEntry.InflationDest = AccountID.Decode(stream);
            }
            decodedAccountEntry.Flags      = Uint32.Decode(stream);
            decodedAccountEntry.HomeDomain = String32.Decode(stream);
            decodedAccountEntry.Thresholds = Thresholds.Decode(stream);
            var signerssize = stream.ReadInt();

            decodedAccountEntry.Signers = new Signer[signerssize];
            for (var i = 0; i < signerssize; i++)
            {
                decodedAccountEntry.Signers[i] = Signer.Decode(stream);
            }
            decodedAccountEntry.Ext = AccountEntryExt.Decode(stream);
            return(decodedAccountEntry);
        }
Beispiel #5
0
 public static void Encode(IByteWriter stream, AccountEntryExt encodedAccountEntryExt)
 {
     XdrEncoding.EncodeInt32(encodedAccountEntryExt.Discriminant, stream);
     switch (encodedAccountEntryExt.Discriminant)
     {
     case 0:
         break;
     }
 }
Beispiel #6
0
 public static void Encode(XdrDataOutputStream stream, AccountEntryExt encodedAccountEntryExt)
 {
     stream.WriteInt(encodedAccountEntryExt.Discriminant);
     switch (encodedAccountEntryExt.Discriminant)
     {
     case 0:
         break;
     }
 }
Beispiel #7
0
            public static AccountEntryExt Decode(IByteReader stream)
            {
                AccountEntryExt decodedAccountEntryExt = new AccountEntryExt();

                decodedAccountEntryExt.Discriminant = XdrEncoding.DecodeInt32(stream);
                switch (decodedAccountEntryExt.Discriminant)
                {
                case 0:
                    break;
                }
                return(decodedAccountEntryExt);
            }
Beispiel #8
0
            public static AccountEntryExt Decode(XdrDataInputStream stream)
            {
                var decodedAccountEntryExt = new AccountEntryExt();
                var discriminant           = stream.ReadInt();

                decodedAccountEntryExt.Discriminant = discriminant;
                switch (decodedAccountEntryExt.Discriminant)
                {
                case 0:
                    break;
                }
                return(decodedAccountEntryExt);
            }
            public static void Encode(XdrDataOutputStream stream, AccountEntryExt encodedAccountEntryExt)
            {
                stream.WriteInt((int)encodedAccountEntryExt.Discriminant);
                switch (encodedAccountEntryExt.Discriminant)
                {
                case 0:
                    break;

                case 1:
                    AccountEntryExtensionV1.Encode(stream, encodedAccountEntryExt.V1);
                    break;
                }
            }
Beispiel #10
0
            public static AccountEntryExt Decode(XdrDataInputStream stream)
            {
                AccountEntryExt decodedAccountEntryExt = new AccountEntryExt();
                int             discriminant           = stream.ReadInt();

                decodedAccountEntryExt.Discriminant = discriminant;
                switch (decodedAccountEntryExt.Discriminant)
                {
                case 0:
                    break;

                case 1:
                    decodedAccountEntryExt.V1 = AccountEntryV1.Decode(stream);
                    break;
                }
                return(decodedAccountEntryExt);
            }
 public static void Encode(IByteWriter stream, AccountEntryExt encodedAccountEntryExt) {
 XdrEncoding.EncodeInt32(encodedAccountEntryExt.Discriminant, stream);
 switch (encodedAccountEntryExt.Discriminant) {
 case 0:
 break;
 }
 }
 public static AccountEntryExt Decode(IByteReader stream) {
   AccountEntryExt decodedAccountEntryExt = new AccountEntryExt();
 decodedAccountEntryExt.Discriminant = XdrEncoding.DecodeInt32(stream);
 switch (decodedAccountEntryExt.Discriminant) {
 case 0:
 break;
 }
   return decodedAccountEntryExt;
 }