<commit_before>package scorex.transaction

import scorex.block.Block
import scorex.transaction.BlockStorage.{Direction, Forward, Reversed}

import scala.util.Try

/**
  * Abstract functional interface of state which is a result of a sequential blocks applying
  */
trait State {
  private[transaction] def processBlock(block: Block, reversal: Boolean): Try[State]

  private[transaction] def processBlock(block: Block, direction: Direction): Try[State] = direction match {
    case Forward => processBlock(block, reversal = false)
    case Reversed => processBlock(block, reversal = true)
  }

  private[transaction] def processBlock(block: Block): Try[State] = processBlock(block, reversal = false)


  /**
    * State is needed to determine whether a transaction was already processed or not.
    * Otherwise, full blockchain scan or storing unique transaction ids is needed and both methods
    * are impractical
    * @param tx - a transaction to check
    * @return whether transaction is already included into a state or not
    */
  //TODO: implement
  def included(tx: Transaction):Boolean = ???
}<commit_msg>formatting<commit_after>package scorex.transaction

import scorex.block.Block
import scorex.transaction.BlockStorage.{Direction, Forward, Reversed}

import scala.util.Try

/**
  * Abstract functional interface of state which is a result of a sequential blocks applying
  */
trait State {
  private[transaction] def processBlock(block: Block, reversal: Boolean): Try[State]

  private[transaction] def processBlock(block: Block, direction: Direction): Try[State] = direction match {
    case Forward => processBlock(block, reversal = false)
    case Reversed => processBlock(block, reversal = true)
  }

  private[transaction] def processBlock(block: Block): Try[State] = processBlock(block, reversal = false)


  /**
    * State is needed to determine whether a transaction was already processed or not.
    * Otherwise, full blockchain scan or storing unique transaction ids is needed and both methods
    * are impractical
    * @param tx - a transaction to check
    * @return whether transaction is already included into a state or not
    */
  //TODO: implement
  def included(tx: Transaction): Boolean = ???
}
{'fraction_non_alphanumeric': 0.08691756272401434, 'fraction_numerical': 0.0, 'mean_word_length': 4.367788461538462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7587737', 'n_tokens_mistral': 594, 'n_tokens_neox': 560, 'n_words': 223}