Exemple #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 OperationMeta Decode(XdrDataInputStream stream)
        {
            OperationMeta decodedOperationMeta = new OperationMeta();

            decodedOperationMeta.Changes = LedgerEntryChanges.Decode(stream);
            return(decodedOperationMeta);
        }
 public static void Encode(XdrDataOutputStream stream, TransactionMetaV1 encodedTransactionMetaV1)
 {
     LedgerEntryChanges.Encode(stream, encodedTransactionMetaV1.TxChanges);
     int operationssize = encodedTransactionMetaV1.Operations.Length;
     stream.WriteInt(operationssize);
     for (int i = 0; i < operationssize; i++)
     {
         OperationMeta.Encode(stream, encodedTransactionMetaV1.Operations[i]);
     }
 }
        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;
        }
Exemple #5
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);
        }
        public static void Encode(XdrDataOutputStream stream, TransactionMeta encodedTransactionMeta)
        {
            stream.WriteInt((int)encodedTransactionMeta.Discriminant);
            switch (encodedTransactionMeta.Discriminant)
            {
            case 0:
                int operationssize = encodedTransactionMeta.Operations.Length;
                stream.WriteInt(operationssize);
                for (int i = 0; i < operationssize; i++)
                {
                    OperationMeta.Encode(stream, encodedTransactionMeta.Operations[i]);
                }
                break;

            case 1:
                TransactionMetaV1.Encode(stream, encodedTransactionMeta.V1);
                break;
            }
        }
 public static void Encode(XdrDataOutputStream stream, OperationMeta encodedOperationMeta)
 {
     LedgerEntryChanges.Encode(stream, encodedOperationMeta.Changes);
 }