Ejemplo n.º 1
0
            public static void Encode(XdrDataOutputStream stream,
                                      InnerTransactionResultResult encodedInnerTransactionResultResult)
            {
                stream.WriteInt((int)encodedInnerTransactionResultResult.Discriminant.InnerValue);
                switch (encodedInnerTransactionResultResult.Discriminant.InnerValue)
                {
                case TransactionResultCode.TransactionResultCodeEnum.txSUCCESS:
                case TransactionResultCode.TransactionResultCodeEnum.txFAILED:
                    int resultssize = encodedInnerTransactionResultResult.Results.Length;
                    stream.WriteInt(resultssize);
                    for (int i = 0; i < resultssize; i++)
                    {
                        OperationResult.Encode(stream, encodedInnerTransactionResultResult.Results[i]);
                    }

                    break;

                case TransactionResultCode.TransactionResultCodeEnum.txTOO_EARLY:
                case TransactionResultCode.TransactionResultCodeEnum.txTOO_LATE:
                case TransactionResultCode.TransactionResultCodeEnum.txMISSING_OPERATION:
                case TransactionResultCode.TransactionResultCodeEnum.txBAD_SEQ:
                case TransactionResultCode.TransactionResultCodeEnum.txBAD_AUTH:
                case TransactionResultCode.TransactionResultCodeEnum.txINSUFFICIENT_BALANCE:
                case TransactionResultCode.TransactionResultCodeEnum.txNO_ACCOUNT:
                case TransactionResultCode.TransactionResultCodeEnum.txINSUFFICIENT_FEE:
                case TransactionResultCode.TransactionResultCodeEnum.txBAD_AUTH_EXTRA:
                case TransactionResultCode.TransactionResultCodeEnum.txINTERNAL_ERROR:
                case TransactionResultCode.TransactionResultCodeEnum.txNOT_SUPPORTED:
                    break;
                }
            }
            public static void Encode(XdrDataOutputStream stream,
                                      TransactionResultResult encodedTransactionResultResult)
            {
                stream.WriteInt((int)encodedTransactionResultResult.Discriminant.InnerValue);
                switch (encodedTransactionResultResult.Discriminant.InnerValue)
                {
                case TransactionResultCode.TransactionResultCodeEnum.txFEE_BUMP_INNER_SUCCESS:
                case TransactionResultCode.TransactionResultCodeEnum.txFEE_BUMP_INNER_FAILED:
                    InnerTransactionResultPair.Encode(stream, encodedTransactionResultResult.InnerResultPair);
                    break;

                case TransactionResultCode.TransactionResultCodeEnum.txSUCCESS:
                case TransactionResultCode.TransactionResultCodeEnum.txFAILED:
                    int resultssize = encodedTransactionResultResult.Results.Length;
                    stream.WriteInt(resultssize);
                    for (int i = 0; i < resultssize; i++)
                    {
                        OperationResult.Encode(stream, encodedTransactionResultResult.Results[i]);
                    }

                    break;

                default:
                    break;
                }
            }