mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Add some hooks to StateMachineManager and NodeSchedulerService so that unit tests of flows with scheduled actions can safely test for completion of their test activities. Typically this is done using a while loop whilst there are active fibers, or schedules and then blocking on the ReusuableLatches until the status changes and can be re-evaluated.
Add unit tests of ScheduledFlow running on simulated network. Just use existing DumyContract in test DummyContract requires value equality so that assertEquals over states works as expected. Remove blank line. Add TODO on waitQuiescent. Fix minor build error
This commit is contained in:
@ -20,10 +20,6 @@ object WorkflowTransactionBuildTutorial {
|
||||
}
|
||||
|
||||
// DOCSTART 1
|
||||
// Helper method to access the StorageService and expand a StateRef into a StateAndRef
|
||||
fun <T : ContractState> ServiceHub.toStateAndRef(ref: StateRef): StateAndRef<T> {
|
||||
return storageService.validatedTransactions.getTransaction(ref.txhash)!!.tx.outRef<T>(ref.index)
|
||||
}
|
||||
|
||||
// Helper method to locate the latest Vault version of a LinearState from a possibly out of date StateRef
|
||||
inline fun <reified T : LinearState> ServiceHub.latest(ref: StateRef): StateAndRef<T> {
|
||||
|
Reference in New Issue
Block a user