<commit_before>package com.wavesplatform.state2

import org.h2.mvstore.MVStore
import org.scalacheck.Gen
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{Matchers, Outcome, fixture}

class StateWriterSpec extends fixture.FunSuite with Matchers with GeneratorDrivenPropertyChecks {
  val stateHeight = 100

  override type FixtureParam = StateStorage

  override protected def withFixture(test: OneArgTest): Outcome = {
    val storage = new StateStorage(new MVStore.Builder().open())
    storage.setHeight(stateHeight)
    test(storage)
  }

  test("increase height when applying block diff") { storage =>
    val writer = new StateWriterImpl(storage)
    forAll(Gen.choose(0, Int.MaxValue)) { heightDiff =>
      val h = writer.height
      writer.applyBlockDiff(BlockDiff(Diff.empty, heightDiff, Map.empty))
      writer.height shouldBe h + heightDiff
      storage.getHeight shouldBe h + heightDiff
    }
  }
}<commit_msg>T715: start height was removed<commit_after>package com.wavesplatform.state2

import org.h2.mvstore.MVStore
import org.scalacheck.Gen
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{Matchers, Outcome, fixture}

class StateWriterSpec extends fixture.FunSuite with Matchers with GeneratorDrivenPropertyChecks {
  override type FixtureParam = StateStorage

  override protected def withFixture(test: OneArgTest): Outcome = {
    val storage = new StateStorage(new MVStore.Builder().open())
    test(storage)
  }

  test("increase height when applying block diff") { storage =>
    val writer = new StateWriterImpl(storage)
    forAll(Gen.choose(0, Int.MaxValue)) { heightDiff =>
      val h = writer.height
      writer.applyBlockDiff(BlockDiff(Diff.empty, heightDiff, Map.empty))
      writer.height shouldBe h + heightDiff
      storage.getHeight shouldBe h + heightDiff
    }
  }
}
{'fraction_non_alphanumeric': 0.08632707774798927, 'fraction_numerical': 0.006434316353887399, 'mean_word_length': 4.488235294117647, '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': '3107796', 'n_tokens_mistral': 558, 'n_tokens_neox': 540, 'n_words': 136}