Skip to content

Commit 0ddc257

Browse files
1.0.0-rc3
1 parent e3425fd commit 0ddc257

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ buildscript {
2929
}
3030

3131
group 'io.onixlabs'
32-
version '1.0.0-rc2'
32+
version '1.0.0-rc3'
3333

3434
subprojects {
3535
repositories {

onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract/AbstractPartyExtensions.kt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,4 @@ val Iterable<AbstractParty>.owningKeys: Set<PublicKey>
3434
* @return Returns a [SecureHash] representing the participants of the initial [Iterable].
3535
*/
3636
val Iterable<AbstractParty>.participantHash: SecureHash
37-
get() = SecureHash.sha256(toSortedSet(IdentityComparator).joinToString())
38-
39-
/**
40-
* Represents the comparator which orders the participants in a collection.
41-
*/
42-
private object IdentityComparator : Comparator<AbstractParty> {
43-
override fun compare(p0: AbstractParty?, p1: AbstractParty?): Int {
44-
return (p0?.hashCode() ?: 0).compareTo(p1?.hashCode() ?: 0)
45-
}
46-
}
37+
get() = SecureHash.sha256(map { SecureHash.sha256(it.toString()) }.toSortedSet().joinToString())

onixlabs-corda-core-workflow/src/main/kotlin/io/onixlabs/corda/core/workflow/FlowLogicExtensions.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import co.paralleluniverse.fibers.Suspendable
2020
import net.corda.core.contracts.ContractState
2121
import net.corda.core.contracts.StateAndRef
2222
import net.corda.core.contracts.StateRef
23+
import net.corda.core.cordapp.CordappContext
2324
import net.corda.core.crypto.SecureHash
2425
import net.corda.core.flows.FlowException
2526
import net.corda.core.flows.FlowLogic
@@ -51,12 +52,18 @@ val FlowLogic<*>.randomNotary: Party
5152
* Gets the preferred notary from the CorDapp config, or alternatively a default notary in the event that
5253
* a preferred notary has not been specified in the CorDapp config.
5354
*
55+
* @param serviceHub The service hub which will be used to obtain a notary from the config file.
5456
* @param defaultSelector The selector function to obtain a notary if none have been specified in the CorDapp config.
5557
* @return Returns the preferred or default notary.
5658
* @throws IllegalArgumentException If the preferred notary cannot be found in the network map cache.
5759
*/
5860
@Suspendable
59-
inline fun FlowLogic<*>.getPreferredNotary(defaultSelector: (ServiceHub) -> Party = { firstNotary }): Party {
61+
fun FlowLogic<*>.getPreferredNotary(
62+
serviceHub: ServiceHub = this.serviceHub,
63+
defaultSelector: (ServiceHub) -> Party = { firstNotary }
64+
): Party {
65+
val cordappContext: CordappContext = serviceHub.getAppContext()
66+
logger.info("Using the specified cordapp for notary selection: ${cordappContext.cordapp.name}")
6067
return if (serviceHub.getAppContext().config.exists("notary")) {
6168
val name = CordaX500Name.parse(serviceHub.getAppContext().config.getString("notary"))
6269
serviceHub.networkMapCache.getNotary(name) ?: throw IllegalArgumentException(

0 commit comments

Comments
 (0)