Move kotlin utility helper out of public into internals. (#2979)

This commit is contained in:
josecoll 2018-04-19 13:48:13 +01:00 committed by GitHub
parent ec70478d70
commit ca55c80bfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -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 <T> Iterable<T>.sumByLong(selector: (T) -> Long): Long = this.map { selector(it) }.sum()

View File

@ -130,7 +130,3 @@ fun <V> Future<V>.getOrThrow(timeout: Duration? = null): V = try {
throw e.cause!!
}
/**
* Extension method for providing a sumBy method that processes and returns a Long
*/
fun <T> Iterable<T>.sumByLong(selector: (T) -> Long): Long = this.map { selector(it) }.sum()

View File

@ -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 {