Kotlin 1.0.0-beta-4584

This commit is contained in:
Mike Hearn 2015-12-24 17:21:10 +00:00
parent 31fbf5e1eb
commit cd7d01917f
5 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ allprojects {
}
buildscript {
ext.kotlin_version = '1.0.0-beta-3594'
ext.kotlin_version = '1.0.0-beta-4584'
repositories {
mavenCentral()
jcenter()
@ -34,6 +34,7 @@ dependencies {
testCompile 'junit:junit:4.11'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
compile "com.google.guava:guava:18.0"
compile "com.esotericsoftware:kryo:3.0.3"
compile "de.javakaffee:kryo-serializers:0.37"

View File

@ -17,7 +17,7 @@ import java.time.*;
import java.util.*;
import static core.ContractsDSLKt.*;
import static kotlin.CollectionsKt.*;
import static kotlin.collections.CollectionsKt.*;
/**
* This is a Java version of the CommercialPaper contract (chosen because it's simple). This demonstrates how the

View File

@ -65,7 +65,7 @@ data class SignedWireTransaction(val txBits: SerializedBytes<WireTransaction>, v
init { check(sigs.isNotEmpty()) }
// Lazily calculated access to the deserialised/hashed transaction data.
@Transient val tx: WireTransaction by lazy { txBits.deserialize() }
val tx: WireTransaction by lazy { txBits.deserialize() }
/** A transaction ID is the hash of the [WireTransaction]. Thus adding or removing a signature does not change it. */
val id: SecureHash get() = txBits.hash

View File

@ -20,7 +20,6 @@ import javax.annotation.concurrent.GuardedBy
import javax.annotation.concurrent.ThreadSafe
import kotlin.concurrent.currentThread
import kotlin.concurrent.thread
import kotlin.test.fail
/**
* An in-memory network allows you to manufacture [Node]s for a set of participants. Each
@ -73,7 +72,7 @@ public class InMemoryNetwork {
for (handle in networkMap.keys)
getQueueForHandle(handle).add(message)
}
else -> fail("Unknown type of recipient handle")
else -> throw IllegalArgumentException("Unknown type of recipient handle")
}
}

View File

@ -38,7 +38,7 @@ open class OpaqueBytes(val bits: ByteArray) {
}
class SerializedBytes<T : Any>(bits: ByteArray) : OpaqueBytes(bits) {
@Transient val hash: SecureHash by lazy { bits.sha256() }
val hash: SecureHash by lazy { bits.sha256() }
}
fun ByteArray.opaque(): OpaqueBytes = OpaqueBytes(this)