File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/main/scala/io/iohk/ethereum/consensus Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import io.iohk.ethereum.ledger.BlockValidation
37
37
import io .iohk .ethereum .mpt .MerklePatriciaTrie .MissingNodeException
38
38
import io .iohk .ethereum .utils .BlockchainConfig
39
39
import io .iohk .ethereum .utils .ByteStringUtils
40
+ import io .iohk .ethereum .utils .FunctorOps ._
40
41
import io .iohk .ethereum .utils .Logger
41
42
42
43
class ConsensusImpl (
@@ -100,12 +101,11 @@ class ConsensusImpl(
100
101
blockchainConfig : BlockchainConfig
101
102
): Task [Either [ValidationBeforeExecError , BlockExecutionSuccess ]] =
102
103
Task
103
- .evalOnce {
104
- val validationResult = blockValidation.validateBlockBeforeExecution(block)
105
- validationResult.left.foreach { error =>
104
+ .evalOnce(blockValidation.validateBlockBeforeExecution(block))
105
+ .tap {
106
+ case Left ( error) =>
106
107
log.error(" Error while validating block with hash {} before execution: {}" , block.hash, error.reason)
107
- }
108
- validationResult
108
+ case Right (_) => log.debug(" Block with hash {} validated successfully" , block.hash)
109
109
}
110
110
.executeOn(validationScheduler)
111
111
You can’t perform that action at this time.
0 commit comments