Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMatthewLayton committed Nov 24, 2021
2 parents 078084e + f722152 commit fa55658
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![ONIX Labs](https://raw.githubusercontent.com/onix-labs/onix-labs.github.io/master/content/logo/master_full_md.png)
![ONIX Labs](https://raw.githubusercontent.com/onix-labs/onixlabs-website/main/src/assets/images/logo/full/original/original-md.png)

# ONIXLabs Corda Core

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=onixlabs-corda-core
group=io.onixlabs
version=3.0.0
version=3.1.0
onixlabs.development.jarsign.keystore=../lib/onixlabs.development.pkcs12
onixlabs.development.jarsign.password=5891f47942424d2acbe108691fdb5ba258712fca7e4762be4327241ebf3dbfa3
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The [ContractState] types to apply to the query criteria.
*/
@QueryDslContext
fun contractStateTypes(values: Iterable<Class<out T>>) {
commonQueryCriteria.contractStateTypes = values.toSet()
fun contractStateTypes(values: Iterable<Class<out T>>?) {
commonQueryCriteria.contractStateTypes = values?.toSet()
criteria = criteria.updateQueryCriteria()
}

Expand All @@ -150,8 +150,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The exact [AbstractParty] participants to apply to the query.
*/
@QueryDslContext
fun exactParticipants(values: Iterable<AbstractParty>) {
commonQueryCriteria.exactParticipants = values.toList()
fun exactParticipants(values: Iterable<AbstractParty>?) {
commonQueryCriteria.exactParticipants = values?.toList()
criteria = criteria.updateQueryCriteria()
}

Expand All @@ -171,8 +171,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The participant [AbstractParty] instances to apply to the query criteria.
*/
@QueryDslContext
fun participants(values: Iterable<AbstractParty>) {
commonQueryCriteria.participants = values.toList()
fun participants(values: Iterable<AbstractParty>?) {
commonQueryCriteria.participants = values?.toList()
criteria = criteria.updateQueryCriteria()
}

Expand Down Expand Up @@ -225,8 +225,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The [String] instances to apply to the query criteria.
*/
@QueryDslContext
fun externalIds(values: Iterable<String?>) {
val criteriaToAdd = LinearStateQueryCriteria(externalId = values.filterNotNull())
fun externalIds(values: Iterable<String>?) {
val criteriaToAdd = LinearStateQueryCriteria(externalId = values?.toList())
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}

Expand All @@ -236,7 +236,7 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The [String] instances to apply to the query criteria.
*/
@QueryDslContext
fun externalIds(vararg values: String?) {
fun externalIds(vararg values: String) {
externalIds(values.toList())
}

Expand All @@ -246,8 +246,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The [UniqueIdentifier] instances to apply to the query criteria.
*/
@QueryDslContext
fun linearIds(values: Iterable<UniqueIdentifier>) {
val criteriaToAdd = LinearStateQueryCriteria(linearId = values.toList())
fun linearIds(values: Iterable<UniqueIdentifier>?) {
val criteriaToAdd = LinearStateQueryCriteria(linearId = values?.toList())
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}

Expand All @@ -267,8 +267,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The [AbstractParty] issuers of [FungibleAsset] states to apply to the query criteria.
*/
@QueryDslContext
fun issuers(values: Iterable<AbstractParty>) {
val criteriaToAdd = FungibleAssetQueryCriteria(issuer = values.toList())
fun issuers(values: Iterable<AbstractParty>?) {
val criteriaToAdd = FungibleAssetQueryCriteria(issuer = values?.toList())
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}

Expand All @@ -288,8 +288,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The [AbstractParty] issuer refs of [FungibleAsset] states to apply to the query criteria.
*/
@QueryDslContext
fun issuerRefs(values: Iterable<OpaqueBytes>) {
val criteriaToAdd = FungibleAssetQueryCriteria(issuerRef = values.toList())
fun issuerRefs(values: Iterable<OpaqueBytes>?) {
val criteriaToAdd = FungibleAssetQueryCriteria(issuerRef = values?.toList())
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}

Expand All @@ -309,8 +309,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The notary [AbstractParty] instances to apply to the query criteria.
*/
@QueryDslContext
fun notaries(values: Iterable<AbstractParty>) {
val criteriaToAdd = VaultQueryCriteria(notary = values.toList())
fun notaries(values: Iterable<AbstractParty>?) {
val criteriaToAdd = VaultQueryCriteria(notary = values?.toList())
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}

Expand All @@ -330,8 +330,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The [AbstractParty] owners of [FungibleAsset] states to apply to the query criteria.
*/
@QueryDslContext
fun owners(values: Iterable<AbstractParty>) {
val criteriaToAdd = FungibleAssetQueryCriteria(owner = values.toList())
fun owners(values: Iterable<AbstractParty>?) {
val criteriaToAdd = FungibleAssetQueryCriteria(owner = values?.toList())
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}

Expand All @@ -351,7 +351,7 @@ class QueryDsl<T : ContractState> internal constructor(
* @param value The [ColumnPredicate] that determines the quantity of a [FungibleAsset] to apply to the query criteria.
*/
@QueryDslContext
fun fungibleAssetQuantity(value: ColumnPredicate<Long>) {
fun fungibleAssetQuantity(value: ColumnPredicate<Long>?) {
val criteriaToAdd = FungibleAssetQueryCriteria(quantity = value)
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}
Expand All @@ -362,7 +362,7 @@ class QueryDsl<T : ContractState> internal constructor(
* @param value The [ColumnPredicate] that determines the quantity of a [FungibleState] to apply to the query criteria.
*/
@QueryDslContext
fun fungibleStateQuantity(value: ColumnPredicate<Long>) {
fun fungibleStateQuantity(value: ColumnPredicate<Long>?) {
val criteriaToAdd = FungibleStateQueryCriteria(quantity = value)
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}
Expand All @@ -373,7 +373,7 @@ class QueryDsl<T : ContractState> internal constructor(
* @param value The [SoftLockingCondition] to apply to the query criteria.
*/
@QueryDslContext
fun softLockingCondition(value: SoftLockingCondition) {
fun softLockingCondition(value: SoftLockingCondition?) {
val criteriaToAdd = VaultQueryCriteria(softLockingCondition = value)
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}
Expand All @@ -384,8 +384,8 @@ class QueryDsl<T : ContractState> internal constructor(
* @param values The [StateRef] instances to apply to the query criteria.
*/
@QueryDslContext
fun stateRefs(values: Iterable<StateRef>) {
val criteriaToAdd = VaultQueryCriteria(stateRefs = values.toList())
fun stateRefs(values: Iterable<StateRef>?) {
val criteriaToAdd = VaultQueryCriteria(stateRefs = values?.toList())
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}

Expand All @@ -405,7 +405,7 @@ class QueryDsl<T : ContractState> internal constructor(
* @param value The [TimeCondition] to apply to the query criteria.
*/
@QueryDslContext
fun timeCondition(value: TimeCondition) {
fun timeCondition(value: TimeCondition?) {
val criteriaToAdd = VaultQueryCriteria(timeCondition = value)
criteria = criteria.and(criteriaToAdd.updateQueryCriteria())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import net.corda.core.utilities.ProgressTracker
* allowing a transaction initiator to specify how each counter-party should record the states of a transaction.
*
* @param statesToRecordBySession A map of [StatesToRecord] by [FlowSession].
* @property sessions The flow sessions of the underlying map.
*/
class StatesToRecordBySession(statesToRecordBySession: Map<FlowSession, StatesToRecord> = emptyMap()) {

Expand All @@ -43,8 +44,8 @@ class StatesToRecordBySession(statesToRecordBySession: Map<FlowSession, StatesTo
statesToRecord: StatesToRecord = StatesToRecord.ONLY_RELEVANT
) : this(sessions.map { it to statesToRecord }.toMap())

val sessions: Set<FlowSession> get() = mutableStatesToRecordBySession.keys
private val mutableStatesToRecordBySession = statesToRecordBySession.toMutableMap()
private val sessions: Set<FlowSession> get() = mutableStatesToRecordBySession.keys

/**
* Sets the [StatesToRecord] for the specified [FlowSession].
Expand Down

0 comments on commit fa55658

Please sign in to comment.