Beispiel #1
0
            public static void Encode(XdrDataOutputStream stream, AccountEntryExtensionV1Ext encodedAccountEntryExtensionV1Ext)
            {
                stream.WriteInt((int)encodedAccountEntryExtensionV1Ext.Discriminant);
                switch (encodedAccountEntryExtensionV1Ext.Discriminant)
                {
                case 0:
                    break;

                case 2:
                    AccountEntryExtensionV2.Encode(stream, encodedAccountEntryExtensionV1Ext.V2);
                    break;
                }
            }
        public static void Encode(XdrDataOutputStream stream, AccountEntryExtensionV2 encodedAccountEntryExtensionV2)
        {
            Uint32.Encode(stream, encodedAccountEntryExtensionV2.NumSponsored);
            Uint32.Encode(stream, encodedAccountEntryExtensionV2.NumSponsoring);
            int signerSponsoringIDssize = encodedAccountEntryExtensionV2.SignerSponsoringIDs.Length;

            stream.WriteInt(signerSponsoringIDssize);
            for (int i = 0; i < signerSponsoringIDssize; i++)
            {
                SponsorshipDescriptor.Encode(stream, encodedAccountEntryExtensionV2.SignerSponsoringIDs[i]);
            }
            AccountEntryExtensionV2Ext.Encode(stream, encodedAccountEntryExtensionV2.Ext);
        }
        public static AccountEntryExtensionV2 Decode(XdrDataInputStream stream)
        {
            AccountEntryExtensionV2 decodedAccountEntryExtensionV2 = new AccountEntryExtensionV2();

            decodedAccountEntryExtensionV2.NumSponsored  = Uint32.Decode(stream);
            decodedAccountEntryExtensionV2.NumSponsoring = Uint32.Decode(stream);
            int signerSponsoringIDssize = stream.ReadInt();

            decodedAccountEntryExtensionV2.SignerSponsoringIDs = new SponsorshipDescriptor[signerSponsoringIDssize];
            for (int i = 0; i < signerSponsoringIDssize; i++)
            {
                decodedAccountEntryExtensionV2.SignerSponsoringIDs[i] = SponsorshipDescriptor.Decode(stream);
            }
            decodedAccountEntryExtensionV2.Ext = AccountEntryExtensionV2Ext.Decode(stream);
            return(decodedAccountEntryExtensionV2);
        }
Beispiel #4
0
            public static AccountEntryExtensionV1Ext Decode(XdrDataInputStream stream)
            {
                AccountEntryExtensionV1Ext decodedAccountEntryExtensionV1Ext = new AccountEntryExtensionV1Ext();
                int discriminant = stream.ReadInt();

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

                case 2:
                    decodedAccountEntryExtensionV1Ext.V2 = AccountEntryExtensionV2.Decode(stream);
                    break;
                }
                return(decodedAccountEntryExtensionV1Ext);
            }