Skip to content

Commit 658f040

Browse files
author
Aurélien Richez
committed
Adds a first test in BlockchainReaderSpec
1 parent 35af28c commit 658f040

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package io.iohk.ethereum.domain
2+
3+
import org.scalatest.flatspec.AnyFlatSpec
4+
import org.scalatest.matchers.should.Matchers
5+
6+
import io.iohk.ethereum.Fixtures
7+
import io.iohk.ethereum.blockchain.sync.EphemBlockchainTestSetup
8+
9+
class BlockchainReaderSpec extends AnyFlatSpec with Matchers {
10+
11+
"BlockchainReader" should "be able to get the best block after it was stored by BlockchainWriter" in new EphemBlockchainTestSetup {
12+
val validBlock = Fixtures.Blocks.ValidBlock.block
13+
14+
blockchainWriter.save(validBlock, Nil, ChainWeight.zero, true)
15+
16+
blockchainReader.getBestBlock() shouldBe Some(validBlock)
17+
}
18+
19+
}

0 commit comments

Comments
 (0)