mirror of
https://github.com/corda/corda.git
synced 2025-06-17 14:48:16 +00:00
Fix serialization of ServiceHub (#1559)
This commit is contained in:
@ -387,7 +387,10 @@ abstract class AbstractNode(open val configuration: NodeConfiguration,
|
|||||||
info = makeInfo(legalIdentity)
|
info = makeInfo(legalIdentity)
|
||||||
|
|
||||||
val tokenizableServices = mutableListOf(attachments, network, services.vaultService, services.vaultQueryService,
|
val tokenizableServices = mutableListOf(attachments, network, services.vaultService, services.vaultQueryService,
|
||||||
services.keyManagementService, services.identityService, platformClock, services.schedulerService)
|
services.keyManagementService, services.identityService, platformClock, services.schedulerService,
|
||||||
|
services.auditService, services.monitoringService, services.networkMapCache, services.schemaService,
|
||||||
|
services.transactionVerifierService, services.validatedTransactions, services.contractUpgradeService,
|
||||||
|
services, this)
|
||||||
makeAdvertisedServices(tokenizableServices)
|
makeAdvertisedServices(tokenizableServices)
|
||||||
return tokenizableServices
|
return tokenizableServices
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,15 @@ package net.corda.node.services.upgrade
|
|||||||
import net.corda.core.contracts.StateRef
|
import net.corda.core.contracts.StateRef
|
||||||
import net.corda.core.contracts.UpgradedContract
|
import net.corda.core.contracts.UpgradedContract
|
||||||
import net.corda.core.node.services.ContractUpgradeService
|
import net.corda.core.node.services.ContractUpgradeService
|
||||||
|
import net.corda.core.serialization.SingletonSerializeAsToken
|
||||||
import net.corda.node.utilities.NODE_DATABASE_PREFIX
|
import net.corda.node.utilities.NODE_DATABASE_PREFIX
|
||||||
import net.corda.node.utilities.PersistentMap
|
import net.corda.node.utilities.PersistentMap
|
||||||
import javax.persistence.*
|
import javax.persistence.Column
|
||||||
|
import javax.persistence.Entity
|
||||||
|
import javax.persistence.Id
|
||||||
|
import javax.persistence.Table
|
||||||
|
|
||||||
class ContractUpgradeServiceImpl : ContractUpgradeService {
|
class ContractUpgradeServiceImpl : ContractUpgradeService, SingletonSerializeAsToken() {
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "${NODE_DATABASE_PREFIX}contract_upgrades")
|
@Table(name = "${NODE_DATABASE_PREFIX}contract_upgrades")
|
||||||
|
@ -22,6 +22,7 @@ import net.corda.core.node.NodeInfo
|
|||||||
import net.corda.core.node.services.ServiceInfo
|
import net.corda.core.node.services.ServiceInfo
|
||||||
import net.corda.core.node.services.Vault
|
import net.corda.core.node.services.Vault
|
||||||
import net.corda.core.serialization.CordaSerializable
|
import net.corda.core.serialization.CordaSerializable
|
||||||
|
import net.corda.core.serialization.SingletonSerializeAsToken
|
||||||
import net.corda.core.toFuture
|
import net.corda.core.toFuture
|
||||||
import net.corda.core.transactions.SignedTransaction
|
import net.corda.core.transactions.SignedTransaction
|
||||||
import net.corda.core.transactions.TransactionBuilder
|
import net.corda.core.transactions.TransactionBuilder
|
||||||
@ -734,7 +735,7 @@ class TwoPartyTradeFlowTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class RecordingTransactionStorage(val database: CordaPersistence, val delegate: WritableTransactionStorage) : WritableTransactionStorage {
|
class RecordingTransactionStorage(val database: CordaPersistence, val delegate: WritableTransactionStorage) : WritableTransactionStorage, SingletonSerializeAsToken() {
|
||||||
override fun track(): DataFeed<List<SignedTransaction>, SignedTransaction> {
|
override fun track(): DataFeed<List<SignedTransaction>, SignedTransaction> {
|
||||||
return database.transaction {
|
return database.transaction {
|
||||||
delegate.track()
|
delegate.track()
|
||||||
|
Reference in New Issue
Block a user