Skip to content

Commit

Permalink
Adds a first test in BlockchainReaderSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurélien Richez committed Jul 27, 2021
1 parent 864523b commit 7b3f03d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/scala/io/iohk/ethereum/domain/BlockchainReaderSpec.scala
@@ -0,0 +1,19 @@
package io.iohk.ethereum.domain

import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

import io.iohk.ethereum.Fixtures
import io.iohk.ethereum.blockchain.sync.EphemBlockchainTestSetup

class BlockchainReaderSpec extends AnyFlatSpec with Matchers {

"BlockchainReader" should "be able to get the best block after it was stored by BlockchainWriter" in new EphemBlockchainTestSetup {
val validBlock = Fixtures.Blocks.ValidBlock.block

blockchainWriter.save(validBlock, Nil, ChainWeight.zero, true)

blockchainReader.getBestBlock() shouldBe Some(validBlock)
}

}

0 comments on commit 7b3f03d

Please sign in to comment.