mirror of
https://github.com/corda/corda.git
synced 2025-04-14 22:46:57 +00:00
addDefaultFixes to IRS Demo to make it work (#885)
This commit is contained in:
parent
aaf7de0d02
commit
6b17a9a948
@ -27,6 +27,7 @@ import net.corda.core.transactions.FilteredTransaction
|
||||
import net.corda.core.utilities.ProgressTracker
|
||||
import net.corda.core.utilities.unwrap
|
||||
import net.corda.irs.flows.RatesFixFlow
|
||||
import org.apache.commons.io.IOUtils
|
||||
import java.math.BigDecimal
|
||||
import java.security.PublicKey
|
||||
import java.time.LocalDate
|
||||
@ -90,7 +91,12 @@ object NodeInterestRates {
|
||||
services.myInfo.serviceIdentities(type).first(),
|
||||
services.myInfo.serviceIdentities(type).first().owningKey.keys.first { services.keyManagementService.keys.contains(it) },
|
||||
services
|
||||
)
|
||||
) {
|
||||
// Set some default fixes to the Oracle, so we can smoothly run the IRS Demo without uploading fixes.
|
||||
// This is required to avoid a situation where the runnodes version of the demo isn't in a good state
|
||||
// upon startup.
|
||||
addDefaultFixes()
|
||||
}
|
||||
// DOCEND 3
|
||||
|
||||
companion object {
|
||||
@ -179,6 +185,10 @@ object NodeInterestRates {
|
||||
fun uploadFixes(s: String) {
|
||||
knownFixes = parseFile(s)
|
||||
}
|
||||
|
||||
private fun addDefaultFixes() {
|
||||
knownFixes = parseFile(IOUtils.toString(Thread.currentThread().contextClassLoader.getResourceAsStream("net/corda/irs/simulation/example.rates.txt"), Charsets.UTF_8.name()))
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: can we split into two? Fix not available (retryable/transient) and unknown (permanent)
|
||||
|
Loading…
x
Reference in New Issue
Block a user