mirror of
https://github.com/corda/corda.git
synced 2025-01-29 15:43:55 +00:00
[CORDA-2174] Fix demo node startup (#4151)
- Make issuableCurrencies config optional - Allow additionalCordapps to override cordappsForAllNodes In driver DSL when passing additionalCordapps to startNode and one of the CordApps is also in cordappsForAllNodes will lead to confilc. This commit is resolving the conflict by using the CordApp provided by additionalCordapps
This commit is contained in:
parent
24e9ceac48
commit
094eb266a8
@ -24,7 +24,12 @@ class ConfigHolder(services: AppServiceHub) : SingletonSerializeAsToken() {
|
||||
val issuableCurrencies: List<Currency>
|
||||
|
||||
init {
|
||||
val issuableCurrenciesStringList: List<String> = uncheckedCast(services.getAppContext().config.get("issuableCurrencies"))
|
||||
val config = services.getAppContext().config
|
||||
val issuableCurrenciesStringList: List<String> = if (config.exists("issuableCurrencies")) {
|
||||
uncheckedCast(config.get("issuableCurrencies"))
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
issuableCurrencies = issuableCurrenciesStringList.map(Currency::getInstance)
|
||||
(issuableCurrencies - supportedCurrencies).let {
|
||||
require(it.isEmpty()) { "$it are not supported currencies" }
|
||||
|
@ -595,7 +595,12 @@ class DriverDSLImpl(
|
||||
emptyList()
|
||||
}
|
||||
|
||||
val cordappDirectories = existingCorDappDirectoriesOption + (cordappsForAllNodes + additionalCordapps).map { TestCordappDirectories.getJarDirectory(it).toString() }
|
||||
// Instead of using cordappsForAllNodes we get only these that are missing from additionalCordapps
|
||||
// This way we prevent errors when we want the same CordApp but with different config
|
||||
val appOverrides = additionalCordapps.map { it.name to it.version}.toSet()
|
||||
val baseCordapps = cordappsForAllNodes.filter { !appOverrides.contains(it.name to it.version) }
|
||||
|
||||
val cordappDirectories = existingCorDappDirectoriesOption + (baseCordapps + additionalCordapps).map { TestCordappDirectories.getJarDirectory(it).toString() }
|
||||
|
||||
val config = NodeConfig(specifiedConfig.typesafe.withValue(NodeConfiguration.cordappDirectoriesKey, ConfigValueFactory.fromIterable(cordappDirectories.toSet())))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user