Skip to content

Commit c866c95

Browse files
committed
Specify the mpt exception
1 parent fe0c1bf commit c866c95

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/scala/io/iohk/ethereum/ledger/BlockExecution.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import io.iohk.ethereum.ledger.BlockExecutionError.MissingParentError
55
import io.iohk.ethereum.ledger.Ledger.BlockResult
66
import io.iohk.ethereum.utils.{BlockchainConfig, DaoForkConfig, Logger}
77
import io.iohk.ethereum.vm.EvmConfig
8+
89
import scala.annotation.tailrec
910
import cats.implicits._
11+
import io.iohk.ethereum.mpt.MerklePatriciaTrie.MPTException
1012

1113
class BlockExecution(
1214
blockchain: BlockchainImpl,
@@ -61,7 +63,7 @@ class BlockExecution(
6163
.toRight(MissingParentError) // Should not never occur because validated earlier
6264
execResult <- executeBlockTransactions(block, parent)
6365
worldToPersist <- Either
64-
.catchOnly[Throwable](blockPreparator.payBlockReward(block, execResult.worldState))
66+
.catchOnly[MPTException](blockPreparator.payBlockReward(block, execResult.worldState))
6567
.leftMap(BlockExecutionError.MPTError.apply)
6668
// State root hash needs to be up-to-date for validateBlockAfterExecution
6769
worldPersisted = InMemoryWorldStateProxy.persistState(worldToPersist)
@@ -188,5 +190,5 @@ object BlockExecutionError {
188190
override val reason: Any = "Cannot find parent"
189191
}
190192

191-
final case class MPTError(reason: Throwable) extends BlockExecutionError
193+
final case class MPTError(reason: MPTException) extends BlockExecutionError
192194
}

0 commit comments

Comments
 (0)