예제 #1
0
        /// <summary>
        /// Should be published for each failed transaction in the block being read.
        /// </summary>
        /// <param name="transactionNumber">One-based number of the transaction in the block.</param>
        /// <param name="transactionId">ID of the transaction.</param>
        /// <param name="errorCode">Code of the error.</param>
        /// <param name="errorMessage">
        /// Optional.
        /// Fee in the particular asset ID, that was spent for the transaction.
        /// Can be omitted, if there was no fee spent for the transaction.
        /// </param>
        /// <param name="fees">
        /// Optional.
        /// Fees in the particular asset, that was spent for the transaction.
        /// Can be omitted, if there was no fee spent for the transaction.
        /// </param>
        public FailedTransaction(
            int transactionNumber,
            TransactionId transactionId,
            TransactionBroadcastingError errorCode,
            string errorMessage,
            IReadOnlyCollection <Fee> fees = null)
        {
            if (transactionNumber < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(transactionNumber), transactionNumber, "Should be zero or positive number");
            }

            FeesValidator.ValidateFeesInResponse(fees);

            TransactionNumber = transactionNumber;
            TransactionId     = transactionId ?? throw new ArgumentNullException(nameof(transactionId));
            ErrorCode         = errorCode;
            ErrorMessage      = errorMessage;
            Fees = fees;
        }
예제 #2
0
 public TransactionBroadcastingException(TransactionBroadcastingError error, string message, Exception inner) :
     base(message, inner)
 {
     Error = error;
 }