mirror of
https://github.com/corda/corda.git
synced 2025-03-22 20:15:19 +00:00
Merge pull request #1536 from corda/feature/vkolomeyko/OS-Ent-merge
OS->Ent merge
This commit is contained in:
commit
ffa1adb5d4
@ -24,7 +24,12 @@ class ConfigHolder(services: AppServiceHub) : SingletonSerializeAsToken() {
|
|||||||
val issuableCurrencies: List<Currency>
|
val issuableCurrencies: List<Currency>
|
||||||
|
|
||||||
init {
|
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 = issuableCurrenciesStringList.map(Currency::getInstance)
|
||||||
(issuableCurrencies - supportedCurrencies).let {
|
(issuableCurrencies - supportedCurrencies).let {
|
||||||
require(it.isEmpty()) { "$it are not supported currencies" }
|
require(it.isEmpty()) { "$it are not supported currencies" }
|
||||||
|
@ -48,11 +48,12 @@ class PersistentUniquenessProviderTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `should commit a transaction with unused inputs without exception`() {
|
fun `should successfully commit a transaction with unused inputs`() {
|
||||||
val provider = PersistentUniquenessProvider(Clock.systemUTC(), database, TestingNamedCacheFactory())
|
val provider = PersistentUniquenessProvider(Clock.systemUTC(), database, TestingNamedCacheFactory())
|
||||||
val inputState = generateStateRef()
|
val inputState = generateStateRef()
|
||||||
|
|
||||||
provider.commit(listOf(inputState), txID, identity, requestSignature).get()
|
val result = provider.commit(listOf(inputState), txID, identity, requestSignature).get()
|
||||||
|
assertEquals(UniquenessProvider.Result.Success, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -62,7 +63,8 @@ class PersistentUniquenessProviderTests {
|
|||||||
|
|
||||||
val inputs = listOf(inputState)
|
val inputs = listOf(inputState)
|
||||||
val firstTxId = txID
|
val firstTxId = txID
|
||||||
provider.commit(inputs, firstTxId, identity, requestSignature).get()
|
val result = provider.commit(inputs, firstTxId, identity, requestSignature).get()
|
||||||
|
assertEquals(UniquenessProvider.Result.Success, result)
|
||||||
|
|
||||||
val secondTxId = SecureHash.randomSHA256()
|
val secondTxId = SecureHash.randomSHA256()
|
||||||
|
|
||||||
|
@ -638,7 +638,12 @@ class DriverDSLImpl(
|
|||||||
emptyList()
|
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())))
|
val config = NodeConfig(specifiedConfig.typesafe.withValue(NodeConfiguration.cordappDirectoriesKey, ConfigValueFactory.fromIterable(cordappDirectories.toSet())))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user