decode method

XdrPathPaymentStrictSendResult decode (
  1. XdrDataInputStream stream
)

Implementation

static XdrPathPaymentStrictSendResult decode(XdrDataInputStream stream) {
  XdrPathPaymentStrictSendResult decodedPathPaymentResult =
      XdrPathPaymentStrictSendResult();
  XdrPathPaymentStrictSendResultCode discriminant =
      XdrPathPaymentStrictSendResultCode.decode(stream);
  decodedPathPaymentResult.discriminant = discriminant;
  switch (decodedPathPaymentResult.discriminant) {
    case XdrPathPaymentStrictSendResultCode.PATH_PAYMENT_STRICT_SEND_SUCCESS:
      decodedPathPaymentResult.success =
          XdrPathPaymentResultSuccess.decode(stream);
      break;
    case XdrPathPaymentStrictSendResultCode
        .PATH_PAYMENT_STRICT_SEND_NO_ISSUER:
      decodedPathPaymentResult.noIssuer = XdrAsset.decode(stream);
      break;
    default:
      break;
  }
  return decodedPathPaymentResult;
}