Esempio n. 1
0
        public static TransactionMeta Decode(XdrDataInputStream stream)
        {
            TransactionMeta decodedTransactionMeta = new TransactionMeta();
            int             discriminant           = stream.ReadInt();

            decodedTransactionMeta.Discriminant = discriminant;
            switch (decodedTransactionMeta.Discriminant)
            {
            case 0:
                int operationssize = stream.ReadInt();
                decodedTransactionMeta.Operations = new OperationMeta[operationssize];
                for (int i = 0; i < operationssize; i++)
                {
                    decodedTransactionMeta.Operations[i] = OperationMeta.Decode(stream);
                }
                break;

            case 1:
                decodedTransactionMeta.V1 = TransactionMetaV1.Decode(stream);
                break;

            case 2:
                decodedTransactionMeta.V2 = TransactionMetaV2.Decode(stream);
                break;
            }
            return(decodedTransactionMeta);
        }
        public static TransactionMetaV1 Decode(XdrDataInputStream stream)
        {
            TransactionMetaV1 decodedTransactionMetaV1 = new TransactionMetaV1();
            decodedTransactionMetaV1.TxChanges = LedgerEntryChanges.Decode(stream);
            int operationssize = stream.ReadInt();
            decodedTransactionMetaV1.Operations = new OperationMeta[operationssize];
            for (int i = 0; i < operationssize; i++)
            {
                decodedTransactionMetaV1.Operations[i] = OperationMeta.Decode(stream);
            }

            return decodedTransactionMetaV1;
        }
Esempio n. 3
0
        public static TransactionMetaV2 Decode(XdrDataInputStream stream)
        {
            TransactionMetaV2 decodedTransactionMetaV2 = new TransactionMetaV2();

            decodedTransactionMetaV2.TxChangesBefore = LedgerEntryChanges.Decode(stream);
            int operationssize = stream.ReadInt();

            decodedTransactionMetaV2.Operations = new OperationMeta[operationssize];
            for (int i = 0; i < operationssize; i++)
            {
                decodedTransactionMetaV2.Operations[i] = OperationMeta.Decode(stream);
            }
            decodedTransactionMetaV2.TxChangesAfter = LedgerEntryChanges.Decode(stream);
            return(decodedTransactionMetaV2);
        }