CORDA-1096 - Performance when loading multiple states from the vault (#2614)

* CORDA-1096 - Performance when loading multiple states from the vault (#2609)

* Provide efficient `loadStates()` implementation

* Replace loops using `loadState` with calls to `loadStates`

* Replace `map`/`flatMap` with just a single `flatMap`
This commit is contained in:
Christian Sailer
2018-02-26 09:37:32 +00:00
committed by GitHub
parent 50ccb32700
commit a483e7e8ce
9 changed files with 31 additions and 16 deletions

View File

@ -2,10 +2,7 @@ package net.corda.node.services
import com.nhaarman.mockito_kotlin.doReturn
import com.nhaarman.mockito_kotlin.whenever
import net.corda.core.contracts.Contract
import net.corda.core.contracts.PartyAndReference
import net.corda.core.contracts.StateRef
import net.corda.core.contracts.TransactionState
import net.corda.core.contracts.*
import net.corda.core.cordapp.CordappProvider
import net.corda.core.flows.FlowLogic
import net.corda.core.flows.UnexpectedFlowEndException
@ -87,6 +84,7 @@ class AttachmentLoadingTests {
private val services = object : ServicesForResolution {
override fun loadState(stateRef: StateRef): TransactionState<*> = throw NotImplementedError()
override fun loadStates(stateRefs: Set<StateRef>): Set<StateAndRef<ContractState>> = throw NotImplementedError()
override val identityService = rigorousMock<IdentityService>().apply {
doReturn(null).whenever(this).partyFromKey(DUMMY_BANK_A.owningKey)
}