Don't fail silently when running flow with no progress tracker from shell.

This commit is contained in:
Joel Dudley 2017-09-01 11:24:16 +01:00 committed by GitHub
commit 1528813d5b
2 changed files with 6 additions and 0 deletions

View File

@ -293,6 +293,10 @@ object InteractiveShell {
continue
}
val flow = ctor.newInstance(*args) as FlowLogic<*>
if (flow.progressTracker == null) {
errors.add("A flow must override the progress tracker in order to be run from the shell")
continue
}
return invoke(flow)
} catch(e: StringToMethodCallParser.UnparseableCallException.MissingParameter) {
errors.add("${getPrototype()}: missing parameter ${e.paramName}")

View File

@ -11,6 +11,7 @@ import net.corda.core.node.ServiceHub
import net.corda.core.transactions.SignedTransaction
import net.corda.core.utilities.UntrustworthyData
import net.corda.client.jackson.JacksonSupport
import net.corda.core.utilities.ProgressTracker
import net.corda.node.services.identity.InMemoryIdentityService
import net.corda.node.shell.InteractiveShell
import net.corda.testing.DUMMY_CA
@ -30,6 +31,7 @@ class InteractiveShellTest {
constructor(pair: Pair<Amount<Currency>, SecureHash.SHA256>) : this(pair.toString())
constructor(party: Party) : this(party.name.toString())
override val progressTracker = ProgressTracker()
override fun call() = a
}