Beispiel #1
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);
        }
Beispiel #2
0
 public static void Encode(IByteWriter stream, PathPaymentResultCode value)
 {
     XdrEncoding.EncodeInt32((int)value.InnerValue, stream);
 }
 public static void Encode(IByteWriter stream, PathPaymentResultCode value)
 {
     XdrEncoding.EncodeInt32((int)value.InnerValue, stream);
 }