diff --git a/core/src/main/kotlin/net/corda/core/internal/InternalUtils.kt b/core/src/main/kotlin/net/corda/core/internal/InternalUtils.kt index 2f3899293f..411bb95454 100644 --- a/core/src/main/kotlin/net/corda/core/internal/InternalUtils.kt +++ b/core/src/main/kotlin/net/corda/core/internal/InternalUtils.kt @@ -464,3 +464,8 @@ fun NotarisationRequest.generateSignature(serviceHub: ServiceHub): NotarisationR } val PublicKey.hash: SecureHash get() = encoded.sha256() + +/** + * Extension method for providing a sumBy method that processes and returns a Long + */ +fun Iterable.sumByLong(selector: (T) -> Long): Long = this.map { selector(it) }.sum() diff --git a/core/src/main/kotlin/net/corda/core/utilities/KotlinUtils.kt b/core/src/main/kotlin/net/corda/core/utilities/KotlinUtils.kt index 183b276fb8..675745f759 100644 --- a/core/src/main/kotlin/net/corda/core/utilities/KotlinUtils.kt +++ b/core/src/main/kotlin/net/corda/core/utilities/KotlinUtils.kt @@ -130,7 +130,3 @@ fun Future.getOrThrow(timeout: Duration? = null): V = try { throw e.cause!! } -/** - * Extension method for providing a sumBy method that processes and returns a Long - */ -fun Iterable.sumByLong(selector: (T) -> Long): Long = this.map { selector(it) }.sum() diff --git a/experimental/behave/src/scenario/kotlin/net/corda/behave/scenarios/steps/VaultSteps.kt b/experimental/behave/src/scenario/kotlin/net/corda/behave/scenarios/steps/VaultSteps.kt index 4a2b7b3c3c..e5249a2bb2 100644 --- a/experimental/behave/src/scenario/kotlin/net/corda/behave/scenarios/steps/VaultSteps.kt +++ b/experimental/behave/src/scenario/kotlin/net/corda/behave/scenarios/steps/VaultSteps.kt @@ -4,7 +4,7 @@ import net.corda.behave.scenarios.ScenarioState import net.corda.behave.scenarios.api.StepsBlock import net.corda.behave.scenarios.helpers.Vault import net.corda.core.contracts.ContractState -import net.corda.core.utilities.sumByLong +import net.corda.core.internal.sumByLong import net.corda.finance.contracts.asset.Cash class VaultSteps : StepsBlock {