Add information on who started flow on a node. (#549)

* Add information on who started flow on a node with name where possible.
Add sealed class holding information on different ways of starting a flow: RPC, peer, shell, scheduled.

* Remove invokeFlowAsync from ServiceHub, move it to ServiceHubInternal.
We shouldn't be able to start new state machines from inside flows.
This commit is contained in:
Katarzyna Streich
2017-04-24 17:05:51 +01:00
committed by GitHub
parent af7f5ef0d7
commit c1b7b1cb75
17 changed files with 170 additions and 57 deletions

View File

@ -3,6 +3,7 @@ package net.corda.testing.node
import net.corda.core.contracts.Attachment
import net.corda.core.contracts.PartyAndReference
import net.corda.core.crypto.*
import net.corda.core.flows.FlowInitiator
import net.corda.core.flows.FlowLogic
import net.corda.core.flows.FlowStateMachine
import net.corda.core.flows.StateMachineRunId
@ -46,10 +47,6 @@ import javax.annotation.concurrent.ThreadSafe
* building chains of transactions and verifying them. It isn't sufficient for testing flows however.
*/
open class MockServices(val key: KeyPair = generateKeyPair()) : ServiceHub {
override fun <T : Any> invokeFlowAsync(logicType: Class<out FlowLogic<T>>, vararg args: Any?): FlowStateMachine<T> {
throw UnsupportedOperationException("not implemented")
}
override fun recordTransactions(txs: Iterable<SignedTransaction>) {
txs.forEach {
storageService.stateMachineRecordedTransactionMapping.addMapping(StateMachineRunId.createRandom(), it.id)