* fix several elements associated with the same key bug (#1625)

* Also make the simulation wait for network map to prevent null pointer when getting notary.
This commit is contained in:
Patrick Kuo 2017-09-25 15:09:26 +01:00 committed by josecoll
parent 798f851def
commit 7ba8576326
2 changed files with 7 additions and 2 deletions

View File

@ -54,7 +54,7 @@ data class PartiallyResolvedTransaction(
class TransactionDataModel {
private val transactions by observable(NodeMonitorModel::transactions)
private val collectedTransactions = transactions.recordInSequence()
private val transactionMap = collectedTransactions.associateBy(SignedTransaction::id)
private val transactionMap = transactions.recordAsAssociation(SignedTransaction::id)
val partiallyResolvedTransactions = collectedTransactions.map {
PartiallyResolvedTransaction.fromSignedTransaction(it, transactionMap)

View File

@ -131,6 +131,11 @@ class ExplorerSimulation(val options: OptionSet) {
bobNode.nodeInfo.legalIdentities.first() to bobRPC,
issuerNodeGBP.nodeInfo.legalIdentities.first() to issuerRPCGBP,
issuerNodeUSD.nodeInfo.legalIdentities.first() to issuerRPCUSD))
aliceRPC.waitUntilNetworkReady()
bobRPC.waitUntilNetworkReady()
issuerRPCGBP.waitUntilNetworkReady()
issuerRPCUSD.waitUntilNetworkReady()
}
private fun startSimulation(eventGenerator: EventGenerator, maxIterations: Int) {
@ -145,7 +150,7 @@ class ExplorerSimulation(val options: OptionSet) {
}
for (i in 0..maxIterations) {
Thread.sleep(300)
Thread.sleep(1000)
// Issuer requests.
eventGenerator.issuerGenerator.map { request ->
when (request) {