Minor: expose the rates oracle service (if the node provides one) as a property

This commit is contained in:
Mike Hearn 2016-03-31 18:20:40 +02:00
parent 10ee49d994
commit cd52ca21ce

View File

@ -113,7 +113,7 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
smm = StateMachineManager(services, serverThread) smm = StateMachineManager(services, serverThread)
wallet = NodeWalletService(services) wallet = NodeWalletService(services)
keyManagement = E2ETestKeyManagementService() keyManagement = E2ETestKeyManagementService()
makeInterestRateOracleService() makeInterestRatesOracleService()
api = APIServerImpl(this) api = APIServerImpl(this)
// Insert a network map entry for the timestamper: this is all temp scaffolding and will go away. If we are // Insert a network map entry for the timestamper: this is all temp scaffolding and will go away. If we are
@ -136,10 +136,12 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
return this return this
} }
protected fun makeInterestRateOracleService() { lateinit var interestRatesService: NodeInterestRates.Service
// Constructing the service registers message handlers that ensure the service won't be garbage collected.
open protected fun makeInterestRatesOracleService() {
// TODO: Once the service has data, automatically register with the network map service (once built). // TODO: Once the service has data, automatically register with the network map service (once built).
_servicesThatAcceptUploads += NodeInterestRates.Service(this) interestRatesService = NodeInterestRates.Service(this)
_servicesThatAcceptUploads += interestRatesService
} }
protected open fun makeIdentityService(): IdentityService { protected open fun makeIdentityService(): IdentityService {