Skip to content

Commit

Permalink
add longer time for Blockchain test MineNextBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
fluency03 committed May 2, 2018
1 parent 325dcc0 commit a5cb94a
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@ class BlockchainActorTest extends TestKit(ActorSystem("BlockchainActorTest")) wi
blockchainActor ! CheckBlockchainValidity
expectMsg(SuccessMsg("true"))

blockchainActor ! MineNextBlock("next", Seq.empty[String])
val actualBlock = expectMsgType[Some[Block]].get
actualBlock.data shouldEqual "next"
actualBlock.transactions shouldEqual Seq.empty[Transaction]
actualBlock.difficulty shouldEqual blockchain.difficulty
actualBlock.index shouldEqual 1
actualBlock.hasValidHash shouldEqual true
actualBlock.previousHash shouldEqual genesis.hash
within(15 seconds) {
blockchainActor ! MineNextBlock("next", Seq.empty[String])
val actualBlock = expectMsgType[Some[Block]].get
actualBlock.data shouldEqual "next"
actualBlock.transactions shouldEqual Seq.empty[Transaction]
actualBlock.difficulty shouldEqual blockchain.difficulty
actualBlock.index shouldEqual 1
actualBlock.hasValidHash shouldEqual true
actualBlock.previousHash shouldEqual genesis.hash
}

blockchainActor ! DeleteBlockchain
expectMsg(SuccessMsg("Blockchain deleted."))
Expand Down

0 comments on commit a5cb94a

Please sign in to comment.