rchain / rchain

Blockchain (smart contract) platform using CBC-Casper proof of stake + Rholang for concurrent execution.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove custom unsafeRunSync as duplicated from Task

tgrospic opened this issue · comments

Overview

Custom extension method unsafeRunSync is duplication of existing method defined on Task runSyncUnsafe.

implicit class TaskOps[A](val task: Task[A]) extends AnyVal {
// TODO: This is duplicated `Task#runSyncUnsafe` / it should be removed
def unsafeRunSync(implicit scheduler: Scheduler): A =
Await.result(
task.runToFuture,
Duration.Inf
)
}

Solution

Refactor all places where unsafeRunSync is used and replace it with runSyncUnsafe.

Remove TaskOps definition completely.