コード例 #1
0
 public static void Encode(IByteWriter stream, PathPaymentResultSuccess encodedPathPaymentResultSuccess) {
   int offerssize = encodedPathPaymentResultSuccess.Offers.Length;
   XdrEncoding.EncodeInt32(offerssize, stream);
   for (int i = 0; i < offerssize; i++) {
     ClaimOfferAtom.Encode(stream, encodedPathPaymentResultSuccess.Offers[i]);
   }
   SimplePaymentResult.Encode(stream, encodedPathPaymentResultSuccess.Last);
 }
コード例 #2
0
 public static PathPaymentResultSuccess Decode(IByteReader stream) {
   PathPaymentResultSuccess decodedPathPaymentResultSuccess = new PathPaymentResultSuccess();
   int offerssize = XdrEncoding.DecodeInt32(stream);
   decodedPathPaymentResultSuccess.Offers = new ClaimOfferAtom[offerssize];
   for (int i = 0; i < offerssize; i++) {
     decodedPathPaymentResultSuccess.Offers[i] = ClaimOfferAtom.Decode(stream);
   }
   decodedPathPaymentResultSuccess.Last = SimplePaymentResult.Decode(stream);
   return decodedPathPaymentResultSuccess;
 }
コード例 #3
0
            public static void Encode(XdrDataOutputStream stream, PathPaymentResultSuccess encodedPathPaymentResultSuccess)
            {
                int offerssize = encodedPathPaymentResultSuccess.Offers.Length;

                stream.WriteInt(offerssize);
                for (int i = 0; i < offerssize; i++)
                {
                    ClaimOfferAtom.Encode(stream, encodedPathPaymentResultSuccess.Offers[i]);
                }
                SimplePaymentResult.Encode(stream, encodedPathPaymentResultSuccess.Last);
            }
コード例 #4
0
            public static void Encode(IByteWriter stream, PathPaymentResultSuccess encodedPathPaymentResultSuccess)
            {
                int offerssize = encodedPathPaymentResultSuccess.Offers.Length;

                XdrEncoding.EncodeInt32(offerssize, stream);
                for (int i = 0; i < offerssize; i++)
                {
                    ClaimOfferAtom.Encode(stream, encodedPathPaymentResultSuccess.Offers[i]);
                }
                SimplePaymentResult.Encode(stream, encodedPathPaymentResultSuccess.Last);
            }
コード例 #5
0
            public static PathPaymentResultSuccess Decode(XdrDataInputStream stream)
            {
                PathPaymentResultSuccess decodedPathPaymentResultSuccess = new PathPaymentResultSuccess();
                int offerssize = stream.ReadInt();

                decodedPathPaymentResultSuccess.Offers = new ClaimOfferAtom[offerssize];
                for (int i = 0; i < offerssize; i++)
                {
                    decodedPathPaymentResultSuccess.Offers[i] = ClaimOfferAtom.Decode(stream);
                }
                decodedPathPaymentResultSuccess.Last = SimplePaymentResult.Decode(stream);
                return(decodedPathPaymentResultSuccess);
            }
コード例 #6
0
            public static PathPaymentResultSuccess Decode(IByteReader stream)
            {
                PathPaymentResultSuccess decodedPathPaymentResultSuccess = new PathPaymentResultSuccess();
                int offerssize = XdrEncoding.DecodeInt32(stream);

                decodedPathPaymentResultSuccess.Offers = new ClaimOfferAtom[offerssize];
                for (int i = 0; i < offerssize; i++)
                {
                    decodedPathPaymentResultSuccess.Offers[i] = ClaimOfferAtom.Decode(stream);
                }
                decodedPathPaymentResultSuccess.Last = SimplePaymentResult.Decode(stream);
                return(decodedPathPaymentResultSuccess);
            }
コード例 #7
0
        public static void Encode(XdrDataOutputStream stream, PathPaymentResult encodedPathPaymentResult)
        {
            stream.WriteInt((int)encodedPathPaymentResult.Discriminant.InnerValue);

            switch (encodedPathPaymentResult.Discriminant.InnerValue)
            {
            case PathPaymentResultCode.PathPaymentResultCodeEnum.PATH_PAYMENT_SUCCESS:
                PathPaymentResultSuccess.Encode(stream, encodedPathPaymentResult.Success);
                break;

            case PathPaymentResultCode.PathPaymentResultCodeEnum.PATH_PAYMENT_NO_ISSUER:
                Asset.Encode(stream, encodedPathPaymentResult.NoIssuer);
                break;
            }
        }
コード例 #8
0
        public static void Encode(IByteWriter stream, PathPaymentResult encodedPathPaymentResult)
        {
            XdrEncoding.EncodeInt32((int)encodedPathPaymentResult.Discriminant.InnerValue, stream);
            switch (encodedPathPaymentResult.Discriminant.InnerValue)
            {
            case PathPaymentResultCode.PathPaymentResultCodeEnum.PATH_PAYMENT_SUCCESS:
                PathPaymentResultSuccess.Encode(stream, encodedPathPaymentResult.Success);
                break;

            case PathPaymentResultCode.PathPaymentResultCodeEnum.PATH_PAYMENT_NO_ISSUER:
                Asset.Encode(stream, encodedPathPaymentResult.NoIssuer);
                break;

            default:
                break;
            }
        }
コード例 #9
0
        public static PathPaymentResult Decode(XdrDataInputStream stream)
        {
            PathPaymentResult     decodedPathPaymentResult = new PathPaymentResult();
            PathPaymentResultCode discriminant             = PathPaymentResultCode.Decode(stream);

            decodedPathPaymentResult.Discriminant = discriminant;

            switch (decodedPathPaymentResult.Discriminant.InnerValue)
            {
            case PathPaymentResultCode.PathPaymentResultCodeEnum.PATH_PAYMENT_SUCCESS:
                decodedPathPaymentResult.Success = PathPaymentResultSuccess.Decode(stream);
                break;

            case PathPaymentResultCode.PathPaymentResultCodeEnum.PATH_PAYMENT_NO_ISSUER:
                decodedPathPaymentResult.NoIssuer = Asset.Decode(stream);
                break;
            }

            return(decodedPathPaymentResult);
        }