Removed the StorageService and puts its components directly into the service hub

This commit is contained in:
Shams Asari
2017-06-29 11:13:40 +01:00
parent ecc96b29b0
commit a08f701dc5
45 changed files with 240 additions and 316 deletions

View File

@ -55,14 +55,14 @@ class BuyerFlow(val otherParty: Party) : FlowLogic<Unit>() {
private fun logIssuanceAttachment(tradeTX: SignedTransaction) {
// Find the original CP issuance.
val search = TransactionGraphSearch(serviceHub.storageService.validatedTransactions, listOf(tradeTX.tx))
val search = TransactionGraphSearch(serviceHub.validatedTransactions, listOf(tradeTX.tx))
search.query = TransactionGraphSearch.Query(withCommandOfType = CommercialPaper.Commands.Issue::class.java,
followInputsOfType = CommercialPaper.State::class.java)
val cpIssuance = search.call().single()
// Buyer will fetch the attachment from the seller automatically when it resolves the transaction.
// For demo purposes just extract attachment jars when saved to disk, so the user can explore them.
val attachmentsPath = (serviceHub.storageService.attachments).let {
val attachmentsPath = (serviceHub.attachments).let {
it.automaticallyExtractAttachments = true
it.storePath
}

View File

@ -79,7 +79,7 @@ class SellerFlow(val otherParty: Party,
// TODO: Consider moving these two steps below into generateIssue.
// Attach the prospectus.
tx.addAttachment(serviceHub.storageService.attachments.openAttachment(PROSPECTUS_HASH)!!.id)
tx.addAttachment(serviceHub.attachments.openAttachment(PROSPECTUS_HASH)!!.id)
// Requesting a time-window to be set, all CP must have a validation window.
tx.addTimeWindow(Instant.now(), 30.seconds)