mirror of
https://github.com/corda/corda.git
synced 2025-06-22 00:57:21 +00:00
Replace PublicKey with PublicKeyTree in Party. A single entity can now be identified by more than one key.
This commit is contained in:
@ -174,8 +174,9 @@ class NodeMonitorModelTest {
|
||||
require(tx.tx.outputs.size == 1)
|
||||
val signaturePubKeys = tx.sigs.map { it.by }.toSet()
|
||||
// Only Alice signed
|
||||
require(signaturePubKeys.size == 1)
|
||||
require(signaturePubKeys.contains(aliceNode.legalIdentity.owningKey))
|
||||
val aliceKey = aliceNode.legalIdentity.owningKey
|
||||
require(signaturePubKeys.size <= aliceKey.keys.size)
|
||||
require(aliceKey.isFulfilledBy(signaturePubKeys))
|
||||
issueTx = tx
|
||||
},
|
||||
// MOVE
|
||||
@ -184,9 +185,8 @@ class NodeMonitorModelTest {
|
||||
require(tx.tx.outputs.size == 1)
|
||||
val signaturePubKeys = tx.sigs.map { it.by }.toSet()
|
||||
// Alice and Notary signed
|
||||
require(signaturePubKeys.size == 2)
|
||||
require(signaturePubKeys.contains(aliceNode.legalIdentity.owningKey))
|
||||
require(signaturePubKeys.contains(notaryNode.notaryIdentity.owningKey))
|
||||
require(aliceNode.legalIdentity.owningKey.isFulfilledBy(signaturePubKeys))
|
||||
require(notaryNode.notaryIdentity.owningKey.isFulfilledBy(signaturePubKeys))
|
||||
moveTx = tx
|
||||
}
|
||||
)
|
||||
|
@ -1,13 +1,13 @@
|
||||
package net.corda.client.model
|
||||
|
||||
import javafx.collections.ObservableList
|
||||
import kotlinx.support.jdk8.collections.removeIf
|
||||
import net.corda.client.fxutils.foldToObservableList
|
||||
import net.corda.client.fxutils.map
|
||||
import net.corda.core.crypto.PublicKeyTree
|
||||
import net.corda.core.node.NodeInfo
|
||||
import net.corda.core.node.services.NetworkMapCache
|
||||
import net.corda.node.services.network.NetworkMapService
|
||||
import javafx.collections.ObservableList
|
||||
import kotlinx.support.jdk8.collections.removeIf
|
||||
import java.security.PublicKey
|
||||
|
||||
class NetworkIdentityModel {
|
||||
private val networkIdentityObservable by observable(NodeMonitorModel::networkMap)
|
||||
@ -34,7 +34,7 @@ class NetworkIdentityModel {
|
||||
return advertisedServices.any { it.info.type == NetworkMapService.type || it.info.type.isNotary() }
|
||||
}
|
||||
|
||||
fun lookup(publicKey: PublicKey): NodeInfo? {
|
||||
return parties.firstOrNull { it.legalIdentity.owningKey == publicKey } ?: notaries.firstOrNull { it.notaryIdentity.owningKey == publicKey }
|
||||
fun lookup(publicKeyTree: PublicKeyTree): NodeInfo? {
|
||||
return parties.firstOrNull { it.legalIdentity.owningKey == publicKeyTree } ?: notaries.firstOrNull { it.notaryIdentity.owningKey == publicKeyTree }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user