Beispiel #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);
        }
Beispiel #2
0
        public static TransactionResultMeta Decode(XdrDataInputStream stream)
        {
            TransactionResultMeta decodedTransactionResultMeta = new TransactionResultMeta();

            decodedTransactionResultMeta.Result            = TransactionResultPair.Decode(stream);
            decodedTransactionResultMeta.FeeProcessing     = LedgerEntryChanges.Decode(stream);
            decodedTransactionResultMeta.TxApplyProcessing = TransactionMeta.Decode(stream);
            return(decodedTransactionResultMeta);
        }
        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;
            }
        }
Beispiel #4
0
 public static void Encode(XdrDataOutputStream stream, TransactionResultMeta encodedTransactionResultMeta)
 {
     TransactionResultPair.Encode(stream, encodedTransactionResultMeta.Result);
     LedgerEntryChanges.Encode(stream, encodedTransactionResultMeta.FeeProcessing);
     TransactionMeta.Encode(stream, encodedTransactionResultMeta.TxApplyProcessing);
 }