public static TransactionResultResult Decode(XdrDataInputStream stream)
            {
                TransactionResultResult decodedTransactionResultResult = new TransactionResultResult();
                TransactionResultCode   discriminant = TransactionResultCode.Decode(stream);

                decodedTransactionResultResult.Discriminant = discriminant;
                switch (decodedTransactionResultResult.Discriminant.InnerValue)
                {
                case TransactionResultCode.TransactionResultCodeEnum.txSUCCESS:
                case TransactionResultCode.TransactionResultCodeEnum.txFAILED:
                    int resultssize = stream.ReadInt();
                    decodedTransactionResultResult.Results = new OperationResult[resultssize];
                    for (int i = 0; i < resultssize; i++)
                    {
                        decodedTransactionResultResult.Results[i] = OperationResult.Decode(stream);
                    }

                    break;

                default:
                    break;
                }

                return(decodedTransactionResultResult);
            }
            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;
                }
            }
        public static TransactionResult Decode(XdrDataInputStream stream)
        {
            var decodedTransactionResult = new TransactionResult();

            decodedTransactionResult.FeeCharged = Int64.Decode(stream);
            decodedTransactionResult.Result     = TransactionResultResult.Decode(stream);
            decodedTransactionResult.Ext        = TransactionResultExt.Decode(stream);
            return(decodedTransactionResult);
        }
Exemplo n.º 4
0
        public static TransactionResult Decode(IByteReader stream)
        {
            TransactionResult decodedTransactionResult = new TransactionResult();

            decodedTransactionResult.FeeCharged = Int64.Decode(stream);
            decodedTransactionResult.Result     = TransactionResultResult.Decode(stream);
            decodedTransactionResult.Ext        = TransactionResultExt.Decode(stream);
            return(decodedTransactionResult);
        }
 public static void Encode(IByteWriter stream, TransactionResultResult encodedTransactionResultResult) {
 XdrEncoding.EncodeInt32((int)encodedTransactionResultResult.Discriminant.InnerValue, stream);
 switch (encodedTransactionResultResult.Discriminant.InnerValue) {
 case TransactionResultCode.TransactionResultCodeEnum.txSUCCESS:
 case TransactionResultCode.TransactionResultCodeEnum.txFAILED:
 int resultssize = encodedTransactionResultResult.Results.Length;
 XdrEncoding.EncodeInt32(resultssize, stream);
 for (int i = 0; i < resultssize; i++) {
   OperationResult.Encode(stream, encodedTransactionResultResult.Results[i]);
 }
 break;
 default:
 break;
 }
 }
 public static TransactionResultResult Decode(IByteReader stream) {
   TransactionResultResult decodedTransactionResultResult = new TransactionResultResult();
 decodedTransactionResultResult.Discriminant = TransactionResultCode.Decode(stream);
 switch (decodedTransactionResultResult.Discriminant.InnerValue) {
 case TransactionResultCode.TransactionResultCodeEnum.txSUCCESS:
 case TransactionResultCode.TransactionResultCodeEnum.txFAILED:
 int resultssize = XdrEncoding.DecodeInt32(stream);
 decodedTransactionResultResult.Results = new OperationResult[resultssize];
 for (int i = 0; i < resultssize; i++) {
   decodedTransactionResultResult.Results[i] = OperationResult.Decode(stream);
 }
 break;
 default:
 break;
 }
   return decodedTransactionResultResult;
 }
Exemplo n.º 7
0
            public static void Encode(IByteWriter stream, TransactionResultResult encodedTransactionResultResult)
            {
                XdrEncoding.EncodeInt32((int)encodedTransactionResultResult.Discriminant.InnerValue, stream);
                switch (encodedTransactionResultResult.Discriminant.InnerValue)
                {
                case TransactionResultCode.TransactionResultCodeEnum.txSUCCESS:
                case TransactionResultCode.TransactionResultCodeEnum.txFAILED:
                    int resultssize = encodedTransactionResultResult.Results.Length;
                    XdrEncoding.EncodeInt32(resultssize, stream);
                    for (int i = 0; i < resultssize; i++)
                    {
                        OperationResult.Encode(stream, encodedTransactionResultResult.Results[i]);
                    }
                    break;

                default:
                    break;
                }
            }
Exemplo n.º 8
0
            public static TransactionResultResult Decode(IByteReader stream)
            {
                TransactionResultResult decodedTransactionResultResult = new TransactionResultResult();

                decodedTransactionResultResult.Discriminant = TransactionResultCode.Decode(stream);
                switch (decodedTransactionResultResult.Discriminant.InnerValue)
                {
                case TransactionResultCode.TransactionResultCodeEnum.txSUCCESS:
                case TransactionResultCode.TransactionResultCodeEnum.txFAILED:
                    int resultssize = XdrEncoding.DecodeInt32(stream);
                    decodedTransactionResultResult.Results = new OperationResult[resultssize];
                    for (int i = 0; i < resultssize; i++)
                    {
                        decodedTransactionResultResult.Results[i] = OperationResult.Decode(stream);
                    }
                    break;

                default:
                    break;
                }
                return(decodedTransactionResultResult);
            }
 public static void Encode(XdrDataOutputStream stream, TransactionResult encodedTransactionResult)
 {
     Int64.Encode(stream, encodedTransactionResult.FeeCharged);
     TransactionResultResult.Encode(stream, encodedTransactionResult.Result);
     TransactionResultExt.Encode(stream, encodedTransactionResult.Ext);
 }
Exemplo n.º 10
0
 public static void Encode(IByteWriter stream, TransactionResult encodedTransactionResult)
 {
     Int64.Encode(stream, encodedTransactionResult.FeeCharged);
     TransactionResultResult.Encode(stream, encodedTransactionResult.Result);
     TransactionResultExt.Encode(stream, encodedTransactionResult.Ext);
 }