Пример #1
0
            public static void Encode(XdrDataOutputStream stream, PathPaymentStrictSendResultSuccess encodedPathPaymentStrictSendResultSuccess)
            {
                int offerssize = encodedPathPaymentStrictSendResultSuccess.Offers.Length;

                stream.WriteInt(offerssize);
                for (int i = 0; i < offerssize; i++)
                {
                    ClaimOfferAtom.Encode(stream, encodedPathPaymentStrictSendResultSuccess.Offers[i]);
                }
                SimplePaymentResult.Encode(stream, encodedPathPaymentStrictSendResultSuccess.Last);
            }
Пример #2
0
            public static PathPaymentStrictSendResultSuccess Decode(XdrDataInputStream stream)
            {
                PathPaymentStrictSendResultSuccess decodedPathPaymentStrictSendResultSuccess = new PathPaymentStrictSendResultSuccess();
                int offerssize = stream.ReadInt();

                decodedPathPaymentStrictSendResultSuccess.Offers = new ClaimOfferAtom[offerssize];
                for (int i = 0; i < offerssize; i++)
                {
                    decodedPathPaymentStrictSendResultSuccess.Offers[i] = ClaimOfferAtom.Decode(stream);
                }
                decodedPathPaymentStrictSendResultSuccess.Last = SimplePaymentResult.Decode(stream);
                return(decodedPathPaymentStrictSendResultSuccess);
            }
Пример #3
0
        public static void Encode(XdrDataOutputStream stream, PathPaymentStrictSendResult encodedPathPaymentStrictSendResult)
        {
            stream.WriteInt((int)encodedPathPaymentStrictSendResult.Discriminant.InnerValue);
            switch (encodedPathPaymentStrictSendResult.Discriminant.InnerValue)
            {
            case PathPaymentStrictSendResultCode.PathPaymentStrictSendResultCodeEnum.PATH_PAYMENT_STRICT_SEND_SUCCESS:
                PathPaymentStrictSendResultSuccess.Encode(stream, encodedPathPaymentStrictSendResult.Success);
                break;

            case PathPaymentStrictSendResultCode.PathPaymentStrictSendResultCodeEnum.PATH_PAYMENT_STRICT_SEND_NO_ISSUER:
                Asset.Encode(stream, encodedPathPaymentStrictSendResult.NoIssuer);
                break;

            default:
                break;
            }
        }
Пример #4
0
        public static PathPaymentStrictSendResult Decode(XdrDataInputStream stream)
        {
            PathPaymentStrictSendResult     decodedPathPaymentStrictSendResult = new PathPaymentStrictSendResult();
            PathPaymentStrictSendResultCode discriminant = PathPaymentStrictSendResultCode.Decode(stream);

            decodedPathPaymentStrictSendResult.Discriminant = discriminant;
            switch (decodedPathPaymentStrictSendResult.Discriminant.InnerValue)
            {
            case PathPaymentStrictSendResultCode.PathPaymentStrictSendResultCodeEnum.PATH_PAYMENT_STRICT_SEND_SUCCESS:
                decodedPathPaymentStrictSendResult.Success = PathPaymentStrictSendResultSuccess.Decode(stream);
                break;

            case PathPaymentStrictSendResultCode.PathPaymentStrictSendResultCodeEnum.PATH_PAYMENT_STRICT_SEND_NO_ISSUER:
                decodedPathPaymentStrictSendResult.NoIssuer = Asset.Decode(stream);
                break;

            default:
                break;
            }
            return(decodedPathPaymentStrictSendResult);
        }