public static void Encode(XdrDataOutputStream stream, FeeBumpTransactionInnerTx encodedFeeBumpTransactionInnerTx)
 {
     stream.WriteInt((int)encodedFeeBumpTransactionInnerTx.Discriminant.InnerValue);
     switch (encodedFeeBumpTransactionInnerTx.Discriminant.InnerValue)
     {
     case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_TX:
         TransactionV1Envelope.Encode(stream, encodedFeeBumpTransactionInnerTx.V1);
         break;
     }
 }
        public static void Encode(XdrDataOutputStream stream, TransactionV1Envelope encodedTransactionV1Envelope)
        {
            Transaction.Encode(stream, encodedTransactionV1Envelope.Tx);
            int signaturessize = encodedTransactionV1Envelope.Signatures.Length;

            stream.WriteInt(signaturessize);
            for (int i = 0; i < signaturessize; i++)
            {
                DecoratedSignature.Encode(stream, encodedTransactionV1Envelope.Signatures[i]);
            }
        }
        public static TransactionV1Envelope Decode(XdrDataInputStream stream)
        {
            TransactionV1Envelope decodedTransactionV1Envelope = new TransactionV1Envelope();

            decodedTransactionV1Envelope.Tx = Transaction.Decode(stream);
            int signaturessize = stream.ReadInt();

            decodedTransactionV1Envelope.Signatures = new DecoratedSignature[signaturessize];
            for (int i = 0; i < signaturessize; i++)
            {
                decodedTransactionV1Envelope.Signatures[i] = DecoratedSignature.Decode(stream);
            }
            return(decodedTransactionV1Envelope);
        }
            public static FeeBumpTransactionInnerTx Decode(XdrDataInputStream stream)
            {
                FeeBumpTransactionInnerTx decodedFeeBumpTransactionInnerTx = new FeeBumpTransactionInnerTx();
                EnvelopeType discriminant = EnvelopeType.Decode(stream);

                decodedFeeBumpTransactionInnerTx.Discriminant = discriminant;
                switch (decodedFeeBumpTransactionInnerTx.Discriminant.InnerValue)
                {
                case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_TX:
                    decodedFeeBumpTransactionInnerTx.V1 = TransactionV1Envelope.Decode(stream);
                    break;
                }
                return(decodedFeeBumpTransactionInnerTx);
            }
Esempio n. 5
0
        public static void Encode(XdrDataOutputStream stream, TransactionEnvelope encodedTransactionEnvelope)
        {
            stream.WriteInt((int)encodedTransactionEnvelope.Discriminant.InnerValue);
            switch (encodedTransactionEnvelope.Discriminant.InnerValue)
            {
            case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_TX_V0:
                TransactionV0Envelope.Encode(stream, encodedTransactionEnvelope.V0);
                break;

            case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_TX:
                TransactionV1Envelope.Encode(stream, encodedTransactionEnvelope.V1);
                break;

            case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_TX_FEE_BUMP:
                FeeBumpTransactionEnvelope.Encode(stream, encodedTransactionEnvelope.FeeBump);
                break;
            }
        }
        public static TransactionEnvelope Decode(XdrDataInputStream stream)
        {
            TransactionEnvelope decodedTransactionEnvelope = new TransactionEnvelope();
            EnvelopeType        discriminant = EnvelopeType.Decode(stream);

            decodedTransactionEnvelope.Discriminant = discriminant;
            switch (decodedTransactionEnvelope.Discriminant.InnerValue)
            {
            case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_TX_V0:
                decodedTransactionEnvelope.V0 = TransactionV0Envelope.Decode(stream);
                break;

            case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_TX:
                decodedTransactionEnvelope.V1 = TransactionV1Envelope.Decode(stream);
                break;

            case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_TX_FEE_BUMP:
                decodedTransactionEnvelope.FeeBump = FeeBumpTransactionEnvelope.Decode(stream);
                break;
            }
            return(decodedTransactionEnvelope);
        }