Run the IntelliJ reformatter across the Kotlin code. Did not reformat JS/web code.

This commit is contained in:
Mike Hearn 2016-11-30 14:40:34 +00:00
parent 4a9f5cafc1
commit 7b40be8361
149 changed files with 763 additions and 618 deletions

View File

@ -34,6 +34,7 @@ class CordaRPCClient(val host: HostAndPort, override val config: NodeSSLConfigur
lateinit var session: ClientSession lateinit var session: ClientSession
lateinit var clientImpl: CordaRPCClientImpl lateinit var clientImpl: CordaRPCClientImpl
} }
private val state = ThreadBox(State()) private val state = ThreadBox(State())
/** Opens the connection to the server and registers a JVM shutdown hook to cleanly disconnect. */ /** Opens the connection to the server and registers a JVM shutdown hook to cleanly disconnect. */

View File

@ -1,11 +1,11 @@
package net.corda.client.fxutils package net.corda.client.fxutils
import net.corda.client.model.ExchangeRate
import net.corda.core.contracts.Amount
import javafx.beans.binding.Bindings import javafx.beans.binding.Bindings
import javafx.beans.value.ObservableValue import javafx.beans.value.ObservableValue
import javafx.collections.ObservableList import javafx.collections.ObservableList
import kotlinx.support.jdk8.collections.stream import kotlinx.support.jdk8.collections.stream
import net.corda.client.model.ExchangeRate
import net.corda.core.contracts.Amount
import org.fxmisc.easybind.EasyBind import org.fxmisc.easybind.EasyBind
import java.util.* import java.util.*
import java.util.stream.Collectors import java.util.stream.Collectors

View File

@ -41,6 +41,7 @@ class ConcatenatedList<A>(sourceList: ObservableList<ObservableList<A>>) : Trans
internal val indexMap = HashMap<WrappedObservableList<out A>, Pair<Int, ListChangeListener<A>>>() internal val indexMap = HashMap<WrappedObservableList<out A>, Pair<Int, ListChangeListener<A>>>()
@VisibleForTesting @VisibleForTesting
internal val nestedIndexOffsets = ArrayList<Int>(sourceList.size) internal val nestedIndexOffsets = ArrayList<Int>(sourceList.size)
init { init {
var offset = 0 var offset = 0
sourceList.forEachIndexed { index, observableList -> sourceList.forEachIndexed { index, observableList ->
@ -229,6 +230,7 @@ class ConcatenatedList<A>(sourceList: ObservableList<ObservableList<A>>) : Trans
// Tracks the first position where the *nested* offset is invalid // Tracks the first position where the *nested* offset is invalid
private var firstInvalidatedPosition = sourceList.size private var firstInvalidatedPosition = sourceList.size
private fun invalidateOffsets(index: Int) { private fun invalidateOffsets(index: Int) {
firstInvalidatedPosition = Math.min(firstInvalidatedPosition, index) firstInvalidatedPosition = Math.min(firstInvalidatedPosition, index)
} }

View File

@ -1,12 +1,10 @@
package net.corda.client.fxutils package net.corda.client.fxutils
import javafx.beans.InvalidationListener
import javafx.beans.value.ChangeListener import javafx.beans.value.ChangeListener
import javafx.beans.value.ObservableValue import javafx.beans.value.ObservableValue
import javafx.collections.ListChangeListener import javafx.collections.ListChangeListener
import javafx.collections.ObservableList import javafx.collections.ObservableList
import javafx.collections.transformation.TransformationList import javafx.collections.transformation.TransformationList
import org.eclipse.jetty.server.Authentication
import java.util.* import java.util.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
@ -30,7 +28,9 @@ class FlattenedList<A>(val sourceList: ObservableList<out ObservableValue<out A>
class WrappedObservableValue<A>( class WrappedObservableValue<A>(
val observableValue: ObservableValue<A> val observableValue: ObservableValue<A>
) )
val indexMap = HashMap<WrappedObservableValue<out A>, Pair<Int, ChangeListener<A>>>() val indexMap = HashMap<WrappedObservableValue<out A>, Pair<Int, ChangeListener<A>>>()
init { init {
sourceList.forEachIndexed { index, observableValue -> sourceList.forEachIndexed { index, observableValue ->
val wrappedObservableValue = WrappedObservableValue(observableValue) val wrappedObservableValue = WrappedObservableValue(observableValue)

View File

@ -2,7 +2,8 @@ package net.corda.client.fxutils
import javafx.beans.property.SimpleObjectProperty import javafx.beans.property.SimpleObjectProperty
import javafx.beans.value.ObservableValue import javafx.beans.value.ObservableValue
import javafx.collections.* import javafx.collections.MapChangeListener
import javafx.collections.ObservableMap
/** /**
* [LeftOuterJoinedMap] implements a special case of a left outer join where we're matching on primary keys of both * [LeftOuterJoinedMap] implements a special case of a left outer join where we're matching on primary keys of both

View File

@ -48,18 +48,22 @@ fun <A, B> ObservableList<out A>.map(cached: Boolean = true, function: (A) -> B)
* val aliceHeightPlus2 = ::sumHeight.lift(aliceHeight, 2L.lift()) * val aliceHeightPlus2 = ::sumHeight.lift(aliceHeight, 2L.lift())
*/ */
fun <A> A.lift(): ObservableValue<A> = ReadOnlyObjectWrapper(this) fun <A> A.lift(): ObservableValue<A> = ReadOnlyObjectWrapper(this)
fun <A, R> ((A) -> R).lift( fun <A, R> ((A) -> R).lift(
arg0: ObservableValue<A> arg0: ObservableValue<A>
): ObservableValue<R> = EasyBind.map(arg0, this) ): ObservableValue<R> = EasyBind.map(arg0, this)
fun <A, B, R> ((A, B) -> R).lift( fun <A, B, R> ((A, B) -> R).lift(
arg0: ObservableValue<A>, arg0: ObservableValue<A>,
arg1: ObservableValue<B> arg1: ObservableValue<B>
): ObservableValue<R> = EasyBind.combine(arg0, arg1, this) ): ObservableValue<R> = EasyBind.combine(arg0, arg1, this)
fun <A, B, C, R> ((A, B, C) -> R).lift( fun <A, B, C, R> ((A, B, C) -> R).lift(
arg0: ObservableValue<A>, arg0: ObservableValue<A>,
arg1: ObservableValue<B>, arg1: ObservableValue<B>,
arg2: ObservableValue<C> arg2: ObservableValue<C>
): ObservableValue<R> = EasyBind.combine(arg0, arg1, arg2, this) ): ObservableValue<R> = EasyBind.combine(arg0, arg1, arg2, this)
fun <A, B, C, D, R> ((A, B, C, D) -> R).lift( fun <A, B, C, D, R> ((A, B, C, D) -> R).lift(
arg0: ObservableValue<A>, arg0: ObservableValue<A>,
arg1: ObservableValue<B>, arg1: ObservableValue<B>,
@ -74,6 +78,7 @@ fun <A, B, C, D, R> ((A, B, C, D) -> R).lift(
*/ */
fun <A, B> ObservableValue<out A>.bind(function: (A) -> ObservableValue<B>): ObservableValue<B> = fun <A, B> ObservableValue<out A>.bind(function: (A) -> ObservableValue<B>): ObservableValue<B> =
EasyBind.monadic(this).flatMap(function) EasyBind.monadic(this).flatMap(function)
/** /**
* A variant of [bind] that has out variance on the output type. This is sometimes useful when kotlin is too eager to * A variant of [bind] that has out variance on the output type. This is sometimes useful when kotlin is too eager to
* propagate variance constraints and type inference fails. * propagate variance constraints and type inference fails.
@ -264,9 +269,11 @@ fun <A : Any, B : Any, K : Any> ObservableList<A>.leftOuterJoin(
fun <A> ObservableList<A>.getValueAt(index: Int): ObservableValue<A?> { fun <A> ObservableList<A>.getValueAt(index: Int): ObservableValue<A?> {
return Bindings.valueAt(this, index) return Bindings.valueAt(this, index)
} }
fun <A> ObservableList<A>.first(): ObservableValue<A?> { fun <A> ObservableList<A>.first(): ObservableValue<A?> {
return getValueAt(0) return getValueAt(0)
} }
fun <A> ObservableList<A>.last(): ObservableValue<A?> { fun <A> ObservableList<A>.last(): ObservableValue<A?> {
return Bindings.createObjectBinding({ return Bindings.createObjectBinding({
if (size > 0) { if (size > 0) {

View File

@ -1,5 +1,6 @@
package net.corda.client.mock package net.corda.client.mock
import net.corda.client.mock.Generator.Companion.choice
import net.corda.core.ErrorOr import net.corda.core.ErrorOr
import java.util.* import java.util.*
@ -39,12 +40,16 @@ class Generator<out A : Any>(val generate: (SplittableRandom) -> ErrorOr<A>) {
// Applicative // Applicative
fun <B : Any> product(other: Generator<(A) -> B>) = fun <B : Any> product(other: Generator<(A) -> B>) =
Generator { generate(it).combine(other.generate(it)) { a, f -> f(a) } } Generator { generate(it).combine(other.generate(it)) { a, f -> f(a) } }
fun <B : Any, R : Any> combine(other1: Generator<B>, function: (A, B) -> R) = fun <B : Any, R : Any> combine(other1: Generator<B>, function: (A, B) -> R) =
product<R>(other1.product(pure({ b -> { a -> function(a, b) } }))) product<R>(other1.product(pure({ b -> { a -> function(a, b) } })))
fun <B : Any, C : Any, R : Any> combine(other1: Generator<B>, other2: Generator<C>, function: (A, B, C) -> R) = fun <B : Any, C : Any, R : Any> combine(other1: Generator<B>, other2: Generator<C>, function: (A, B, C) -> R) =
product<R>(other1.product(other2.product(pure({ c -> { b -> { a -> function(a, b, c) } } })))) product<R>(other1.product(other2.product(pure({ c -> { b -> { a -> function(a, b, c) } } }))))
fun <B : Any, C : Any, D : Any, R : Any> combine(other1: Generator<B>, other2: Generator<C>, other3: Generator<D>, function: (A, B, C, D) -> R) = fun <B : Any, C : Any, D : Any, R : Any> combine(other1: Generator<B>, other2: Generator<C>, other3: Generator<D>, function: (A, B, C, D) -> R) =
product<R>(other1.product(other2.product(other3.product(pure({ d -> { c -> { b -> { a -> function(a, b, c, d) } } } }))))) product<R>(other1.product(other2.product(other3.product(pure({ d -> { c -> { b -> { a -> function(a, b, c, d) } } } })))))
fun <B : Any, C : Any, D : Any, E : Any, R : Any> combine(other1: Generator<B>, other2: Generator<C>, other3: Generator<D>, other4: Generator<E>, function: (A, B, C, D, E) -> R) = fun <B : Any, C : Any, D : Any, E : Any, R : Any> combine(other1: Generator<B>, other2: Generator<C>, other3: Generator<D>, other4: Generator<E>, function: (A, B, C, D, E) -> R) =
product<R>(other1.product(other2.product(other3.product(other4.product(pure({ e -> { d -> { c -> { b -> { a -> function(a, b, c, d, e) } } } } })))))) product<R>(other1.product(other2.product(other3.product(other4.product(pure({ e -> { d -> { c -> { b -> { a -> function(a, b, c, d, e) } } } } }))))))
@ -122,14 +127,17 @@ fun Generator.Companion.int() = Generator.success(SplittableRandom::nextInt)
fun Generator.Companion.bytes(size: Int): Generator<ByteArray> = Generator.success { random -> fun Generator.Companion.bytes(size: Int): Generator<ByteArray> = Generator.success { random ->
ByteArray(size) { random.nextInt().toByte() } ByteArray(size) { random.nextInt().toByte() }
} }
fun Generator.Companion.intRange(range: IntRange) = intRange(range.first, range.last) fun Generator.Companion.intRange(range: IntRange) = intRange(range.first, range.last)
fun Generator.Companion.intRange(from: Int, to: Int): Generator<Int> = Generator.success { fun Generator.Companion.intRange(from: Int, to: Int): Generator<Int> = Generator.success {
(from + Math.abs(it.nextInt()) % (to - from + 1)).toInt() (from + Math.abs(it.nextInt()) % (to - from + 1)).toInt()
} }
fun Generator.Companion.longRange(range: LongRange) = longRange(range.first, range.last) fun Generator.Companion.longRange(range: LongRange) = longRange(range.first, range.last)
fun Generator.Companion.longRange(from: Long, to: Long): Generator<Long> = Generator.success { fun Generator.Companion.longRange(from: Long, to: Long): Generator<Long> = Generator.success {
(from + Math.abs(it.nextLong()) % (to - from + 1)).toLong() (from + Math.abs(it.nextLong()) % (to - from + 1)).toLong()
} }
fun Generator.Companion.double() = Generator.success { it.nextDouble() } fun Generator.Companion.double() = Generator.success { it.nextDouble() }
fun Generator.Companion.doubleRange(from: Double, to: Double): Generator<Double> = Generator.success { fun Generator.Companion.doubleRange(from: Double, to: Double): Generator<Double> = Generator.success {
from + it.nextDouble() * (to - from) from + it.nextDouble() * (to - from)
@ -188,6 +196,7 @@ fun <A : Any> Generator.Companion.pickN(number: Int, list: List<A>) = Generator<
fun <A> Generator.Companion.sampleBernoulli(maxRatio: Double = 1.0, vararg collection: A) = fun <A> Generator.Companion.sampleBernoulli(maxRatio: Double = 1.0, vararg collection: A) =
sampleBernoulli(listOf(collection), maxRatio) sampleBernoulli(listOf(collection), maxRatio)
fun <A> Generator.Companion.sampleBernoulli(collection: Collection<A>, maxRatio: Double = 1.0): Generator<List<A>> = fun <A> Generator.Companion.sampleBernoulli(collection: Collection<A>, maxRatio: Double = 1.0): Generator<List<A>> =
intRange(0, (maxRatio * collection.size).toInt()).bind { howMany -> intRange(0, (maxRatio * collection.size).toInt()).bind { howMany ->
replicate(collection.size, Generator.doubleRange(0.0, 1.0)).map { chances -> replicate(collection.size, Generator.doubleRange(0.0, 1.0)).map { chances ->

View File

@ -1,16 +1,18 @@
package net.corda.client.model package net.corda.client.model
import net.corda.core.contracts.Amount
import javafx.beans.property.SimpleObjectProperty import javafx.beans.property.SimpleObjectProperty
import javafx.beans.value.ObservableValue import javafx.beans.value.ObservableValue
import net.corda.core.contracts.Amount
import java.util.* import java.util.*
interface ExchangeRate { interface ExchangeRate {
fun rate(from: Currency, to: Currency): Double fun rate(from: Currency, to: Currency): Double
} }
fun ExchangeRate.exchangeAmount(amount: Amount<Currency>, to: Currency) = fun ExchangeRate.exchangeAmount(amount: Amount<Currency>, to: Currency) =
Amount(exchangeDouble(amount, to).toLong(), to) Amount(exchangeDouble(amount, to).toLong(), to)
fun ExchangeRate.exchangeDouble(amount: Amount<Currency>, to: Currency) = fun ExchangeRate.exchangeDouble(amount: Amount<Currency>, to: Currency) =
rate(amount.token, to) * amount.quantity rate(amount.token, to) * amount.quantity

View File

@ -10,7 +10,6 @@ import net.corda.core.contracts.StateAndRef
import net.corda.core.contracts.StateRef import net.corda.core.contracts.StateRef
import net.corda.core.crypto.SecureHash import net.corda.core.crypto.SecureHash
import net.corda.core.flows.StateMachineRunId import net.corda.core.flows.StateMachineRunId
import net.corda.core.node.services.StateMachineTransactionMapping
import net.corda.core.transactions.SignedTransaction import net.corda.core.transactions.SignedTransaction
import net.corda.node.services.messaging.StateMachineUpdate import net.corda.node.services.messaging.StateMachineUpdate
import org.fxmisc.easybind.EasyBind import org.fxmisc.easybind.EasyBind
@ -29,6 +28,7 @@ data class PartiallyResolvedTransaction(
val transaction: SignedTransaction, val transaction: SignedTransaction,
val inputs: List<ObservableValue<InputResolution>>) { val inputs: List<ObservableValue<InputResolution>>) {
val id = transaction.id val id = transaction.id
sealed class InputResolution(val stateRef: StateRef) { sealed class InputResolution(val stateRef: StateRef) {
class Unresolved(stateRef: StateRef) : InputResolution(stateRef) class Unresolved(stateRef: StateRef) : InputResolution(stateRef)
class Resolved(val stateAndRef: StateAndRef<ContractState>) : InputResolution(stateAndRef.ref) class Resolved(val stateAndRef: StateAndRef<ContractState>) : InputResolution(stateAndRef.ref)
@ -56,6 +56,7 @@ data class PartiallyResolvedTransaction(
sealed class TransactionCreateStatus(val message: String?) { sealed class TransactionCreateStatus(val message: String?) {
class Started(message: String?) : TransactionCreateStatus(message) class Started(message: String?) : TransactionCreateStatus(message)
class Failed(message: String?) : TransactionCreateStatus(message) class Failed(message: String?) : TransactionCreateStatus(message)
override fun toString(): String = message ?: javaClass.simpleName override fun toString(): String = message ?: javaClass.simpleName
} }
@ -66,6 +67,7 @@ data class FlowStatus(
sealed class StateMachineStatus(val stateMachineName: String) { sealed class StateMachineStatus(val stateMachineName: String) {
class Added(stateMachineName: String) : StateMachineStatus(stateMachineName) class Added(stateMachineName: String) : StateMachineStatus(stateMachineName)
class Removed(stateMachineName: String) : StateMachineStatus(stateMachineName) class Removed(stateMachineName: String) : StateMachineStatus(stateMachineName)
override fun toString(): String = "${javaClass.simpleName}($stateMachineName)" override fun toString(): String = "${javaClass.simpleName}($stateMachineName)"
} }

View File

@ -116,57 +116,69 @@ object Models {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
return model as M return model as M
} }
inline fun <reified M : Any> get(origin: KClass<*>): M = get(M::class, origin) inline fun <reified M : Any> get(origin: KClass<*>): M = get(M::class, origin)
} }
sealed class TrackedDelegate<M : Any>(val klass: KClass<M>) { sealed class TrackedDelegate<M : Any>(val klass: KClass<M>) {
init { Models.initModel(klass) } init {
Models.initModel(klass)
}
class ObservableDelegate<M : Any, T>(klass: KClass<M>, val observableProperty: (M) -> Observable<T>) : TrackedDelegate<M>(klass) { class ObservableDelegate<M : Any, T>(klass: KClass<M>, val observableProperty: (M) -> Observable<T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): Observable<T> { operator fun getValue(thisRef: Any, property: KProperty<*>): Observable<T> {
return observableProperty(Models.get(klass, thisRef.javaClass.kotlin)) return observableProperty(Models.get(klass, thisRef.javaClass.kotlin))
} }
} }
class ObserverDelegate<M : Any, T>(klass: KClass<M>, val observerProperty: (M) -> Observer<T>) : TrackedDelegate<M>(klass) { class ObserverDelegate<M : Any, T>(klass: KClass<M>, val observerProperty: (M) -> Observer<T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): Observer<T> { operator fun getValue(thisRef: Any, property: KProperty<*>): Observer<T> {
return observerProperty(Models.get(klass, thisRef.javaClass.kotlin)) return observerProperty(Models.get(klass, thisRef.javaClass.kotlin))
} }
} }
class SubjectDelegate<M : Any, T>(klass: KClass<M>, val subjectProperty: (M) -> Subject<T, T>) : TrackedDelegate<M>(klass) { class SubjectDelegate<M : Any, T>(klass: KClass<M>, val subjectProperty: (M) -> Subject<T, T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): Subject<T, T> { operator fun getValue(thisRef: Any, property: KProperty<*>): Subject<T, T> {
return subjectProperty(Models.get(klass, thisRef.javaClass.kotlin)) return subjectProperty(Models.get(klass, thisRef.javaClass.kotlin))
} }
} }
class EventStreamDelegate<M : Any, T>(klass: KClass<M>, val eventStreamProperty: (M) -> org.reactfx.EventStream<T>) : TrackedDelegate<M>(klass) { class EventStreamDelegate<M : Any, T>(klass: KClass<M>, val eventStreamProperty: (M) -> org.reactfx.EventStream<T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): org.reactfx.EventStream<T> { operator fun getValue(thisRef: Any, property: KProperty<*>): org.reactfx.EventStream<T> {
return eventStreamProperty(Models.get(klass, thisRef.javaClass.kotlin)) return eventStreamProperty(Models.get(klass, thisRef.javaClass.kotlin))
} }
} }
class EventSinkDelegate<M : Any, T>(klass: KClass<M>, val eventSinkProperty: (M) -> org.reactfx.EventSink<T>) : TrackedDelegate<M>(klass) { class EventSinkDelegate<M : Any, T>(klass: KClass<M>, val eventSinkProperty: (M) -> org.reactfx.EventSink<T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): org.reactfx.EventSink<T> { operator fun getValue(thisRef: Any, property: KProperty<*>): org.reactfx.EventSink<T> {
return eventSinkProperty(Models.get(klass, thisRef.javaClass.kotlin)) return eventSinkProperty(Models.get(klass, thisRef.javaClass.kotlin))
} }
} }
class ObservableValueDelegate<M : Any, T>(klass: KClass<M>, val observableValueProperty: (M) -> ObservableValue<T>) : TrackedDelegate<M>(klass) { class ObservableValueDelegate<M : Any, T>(klass: KClass<M>, val observableValueProperty: (M) -> ObservableValue<T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): ObservableValue<T> { operator fun getValue(thisRef: Any, property: KProperty<*>): ObservableValue<T> {
return observableValueProperty(Models.get(klass, thisRef.javaClass.kotlin)) return observableValueProperty(Models.get(klass, thisRef.javaClass.kotlin))
} }
} }
class WritableValueDelegate<M : Any, T>(klass: KClass<M>, val writableValueProperty: (M) -> WritableValue<T>) : TrackedDelegate<M>(klass) { class WritableValueDelegate<M : Any, T>(klass: KClass<M>, val writableValueProperty: (M) -> WritableValue<T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): WritableValue<T> { operator fun getValue(thisRef: Any, property: KProperty<*>): WritableValue<T> {
return writableValueProperty(Models.get(klass, thisRef.javaClass.kotlin)) return writableValueProperty(Models.get(klass, thisRef.javaClass.kotlin))
} }
} }
class ObservableListDelegate<M : Any, T>(klass: KClass<M>, val observableListProperty: (M) -> ObservableList<T>) : TrackedDelegate<M>(klass) { class ObservableListDelegate<M : Any, T>(klass: KClass<M>, val observableListProperty: (M) -> ObservableList<T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): ObservableList<T> { operator fun getValue(thisRef: Any, property: KProperty<*>): ObservableList<T> {
return observableListProperty(Models.get(klass, thisRef.javaClass.kotlin)) return observableListProperty(Models.get(klass, thisRef.javaClass.kotlin))
} }
} }
class ObservableListReadOnlyDelegate<M : Any, out T>(klass: KClass<M>, val observableListReadOnlyProperty: (M) -> ObservableList<out T>) : TrackedDelegate<M>(klass) { class ObservableListReadOnlyDelegate<M : Any, out T>(klass: KClass<M>, val observableListReadOnlyProperty: (M) -> ObservableList<out T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): ObservableList<out T> { operator fun getValue(thisRef: Any, property: KProperty<*>): ObservableList<out T> {
return observableListReadOnlyProperty(Models.get(klass, thisRef.javaClass.kotlin)) return observableListReadOnlyProperty(Models.get(klass, thisRef.javaClass.kotlin))
} }
} }
class ObjectPropertyDelegate<M : Any, T>(klass: KClass<M>, val objectPropertyProperty: (M) -> ObjectProperty<T>) : TrackedDelegate<M>(klass) { class ObjectPropertyDelegate<M : Any, T>(klass: KClass<M>, val objectPropertyProperty: (M) -> ObjectProperty<T>) : TrackedDelegate<M>(klass) {
operator fun getValue(thisRef: Any, property: KProperty<*>): ObjectProperty<T> { operator fun getValue(thisRef: Any, property: KProperty<*>): ObjectProperty<T> {
return objectPropertyProperty(Models.get(klass, thisRef.javaClass.kotlin)) return objectPropertyProperty(Models.get(klass, thisRef.javaClass.kotlin))

View File

@ -81,6 +81,7 @@ class ClientRPCInfrastructureTests {
} }
producer.send(toAddress, msg) producer.send(toAddress, msg)
} }
override fun getUser(message: ClientMessage): User = authenticatedUser override fun getUser(message: ClientMessage): User = authenticatedUser
} }
serverThread = AffinityExecutor.ServiceAffinityExecutor("unit-tests-rpc-dispatch-thread", 1) serverThread = AffinityExecutor.ServiceAffinityExecutor("unit-tests-rpc-dispatch-thread", 1)
@ -139,7 +140,8 @@ class ClientRPCInfrastructureTests {
override fun barf(): Unit = throw IllegalArgumentException("Barf!") override fun barf(): Unit = throw IllegalArgumentException("Barf!")
override fun void() { } override fun void() {
}
override fun someCalculation(str: String, num: Int) = "$str $num" override fun someCalculation(str: String, num: Int) = "$str $num"

View File

@ -4,7 +4,6 @@ import javafx.collections.FXCollections
import javafx.collections.ObservableList import javafx.collections.ObservableList
import org.junit.Before import org.junit.Before
import org.junit.Test import org.junit.Test
import java.util.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
class LeftOuterJoinedMapTest { class LeftOuterJoinedMapTest {

View File

@ -1,7 +1,7 @@
package net.corda.core.crypto; package net.corda.core.crypto;
import java.math.BigInteger; import java.math.*;
import java.util.Arrays; import java.util.*;
/** /**
* Base58 is a way to encode Bitcoin addresses (or arbitrary data) as alphanumeric strings. * Base58 is a way to encode Bitcoin addresses (or arbitrary data) as alphanumeric strings.
@ -128,8 +128,8 @@ public class Base58 {
* removed from the returned data. * removed from the returned data.
* *
* @param input the base58-encoded string to decode (which should include the checksum) * @param input the base58-encoded string to decode (which should include the checksum)
* @throws AddressFormatException if the input is not base 58 or the checksum does not validate.
* @return the original data bytes less the last 4 bytes (the checksum). * @return the original data bytes less the last 4 bytes (the checksum).
* @throws AddressFormatException if the input is not base 58 or the checksum does not validate.
*/ */
public static byte[] decodeChecked(String input) throws AddressFormatException { public static byte[] decodeChecked(String input) throws AddressFormatException {
byte[] decoded = decode(input); byte[] decoded = decode(input);

View File

@ -51,6 +51,7 @@ fun String.abbreviate(maxWidth: Int): String = if (length <= maxWidth) this else
/** Like the + operator but throws an exception in case of integer overflow. */ /** Like the + operator but throws an exception in case of integer overflow. */
infix fun Int.checkedAdd(b: Int) = Math.addExact(this, b) infix fun Int.checkedAdd(b: Int) = Math.addExact(this, b)
/** Like the + operator but throws an exception in case of integer overflow. */ /** Like the + operator but throws an exception in case of integer overflow. */
@Suppress("unused") @Suppress("unused")
infix fun Long.checkedAdd(b: Long) = Math.addExact(this, b) infix fun Long.checkedAdd(b: Long) = Math.addExact(this, b)
@ -125,6 +126,7 @@ fun <A> ListenableFuture<A>.toObservable(): Observable<A> {
/** Allows you to write code like: Paths.get("someDir") / "subdir" / "filename" but using the Paths API to avoid platform separator problems. */ /** Allows you to write code like: Paths.get("someDir") / "subdir" / "filename" but using the Paths API to avoid platform separator problems. */
operator fun Path.div(other: String): Path = resolve(other) operator fun Path.div(other: String): Path = resolve(other)
fun Path.createDirectory(vararg attrs: FileAttribute<*>): Path = Files.createDirectory(this, *attrs) fun Path.createDirectory(vararg attrs: FileAttribute<*>): Path = Files.createDirectory(this, *attrs)
fun Path.createDirectories(vararg attrs: FileAttribute<*>): Path = Files.createDirectories(this, *attrs) fun Path.createDirectories(vararg attrs: FileAttribute<*>): Path = Files.createDirectories(this, *attrs)
fun Path.exists(vararg options: LinkOption): Boolean = Files.exists(this, *options) fun Path.exists(vararg options: LinkOption): Boolean = Files.exists(this, *options)
@ -142,6 +144,7 @@ inline fun Path.write(createDirs: Boolean = false, vararg options: OpenOption =
} }
Files.newOutputStream(this, *options).use(block) Files.newOutputStream(this, *options).use(block)
} }
inline fun <R> Path.readLines(charset: Charset = UTF_8, block: (Stream<String>) -> R): R = Files.lines(this, charset).use(block) inline fun <R> Path.readLines(charset: Charset = UTF_8, block: (Stream<String>) -> R): R = Files.lines(this, charset).use(block)
fun Path.writeLines(lines: Iterable<CharSequence>, charset: Charset = UTF_8, vararg options: OpenOption): Path = Files.write(this, lines, charset, *options) fun Path.writeLines(lines: Iterable<CharSequence>, charset: Charset = UTF_8, vararg options: OpenOption): Path = Files.write(this, lines, charset, *options)
@ -233,6 +236,7 @@ class ThreadBox<out T>(val content: T, val lock: ReentrantLock = ReentrantLock()
check(lock.isHeldByCurrentThread, { "Expected $lock to already be locked." }) check(lock.isHeldByCurrentThread, { "Expected $lock to already be locked." })
return body(content) return body(content)
} }
fun checkNotLocked() = check(!lock.isHeldByCurrentThread) fun checkNotLocked() = check(!lock.isHeldByCurrentThread)
} }
@ -300,7 +304,12 @@ data class ErrorOr<out A> private constructor(val value: A?, val error: Throwabl
companion object { companion object {
/** Runs the given lambda and wraps the result. */ /** Runs the given lambda and wraps the result. */
inline fun <T : Any> catch(body: () -> T): ErrorOr<T> = try { ErrorOr(body()) } catch (t: Throwable) { ErrorOr.of(t) } inline fun <T : Any> catch(body: () -> T): ErrorOr<T> = try {
ErrorOr(body())
} catch (t: Throwable) {
ErrorOr.of(t)
}
fun of(t: Throwable) = ErrorOr(null, t) fun of(t: Throwable) = ErrorOr(null, t)
} }

View File

@ -1,4 +1,5 @@
@file:JvmName("ContractsDSL") @file:JvmName("ContractsDSL")
package net.corda.core.contracts package net.corda.core.contracts
import net.corda.core.crypto.CompositeKey import net.corda.core.crypto.CompositeKey
@ -19,6 +20,7 @@ import java.util.*
//// Currencies /////////////////////////////////////////////////////////////////////////////////////////////////////// //// Currencies ///////////////////////////////////////////////////////////////////////////////////////////////////////
fun currency(code: String) = Currency.getInstance(code)!! fun currency(code: String) = Currency.getInstance(code)!!
fun commodity(code: String) = Commodity.getInstance(code)!! fun commodity(code: String) = Commodity.getInstance(code)!!
@JvmField val USD = currency("USD") @JvmField val USD = currency("USD")

View File

@ -1,6 +1,7 @@
package net.corda.core.contracts package net.corda.core.contracts
import net.corda.core.crypto.CompositeKey import net.corda.core.crypto.CompositeKey
/** /**
* Dummy state for use in testing. Not part of any contract, not even the [DummyContract]. * Dummy state for use in testing. Not part of any contract, not even the [DummyContract].
*/ */

View File

@ -442,6 +442,7 @@ data class Commodity(val commodityCode: String,
// Simple example commodity, as in http://www.investopedia.com/university/commodities/commodities14.asp // Simple example commodity, as in http://www.investopedia.com/university/commodities/commodities14.asp
Pair("FCOJ", Commodity("FCOJ", "Frozen concentrated orange juice")) Pair("FCOJ", Commodity("FCOJ", "Frozen concentrated orange juice"))
) )
fun getInstance(commodityCode: String): Commodity? fun getInstance(commodityCode: String): Commodity?
= registry[commodityCode] = registry[commodityCode]
} }
@ -461,6 +462,7 @@ data class Commodity(val commodityCode: String,
*/ */
data class UniqueIdentifier(val externalId: String? = null, val id: UUID = UUID.randomUUID()) : Comparable<UniqueIdentifier> { data class UniqueIdentifier(val externalId: String? = null, val id: UUID = UUID.randomUUID()) : Comparable<UniqueIdentifier> {
override fun toString(): String = if (externalId != null) "${externalId}_$id" else id.toString() override fun toString(): String = if (externalId != null) "${externalId}_$id" else id.toString()
companion object { companion object {
/** /**
* Helper function for unit tests where the UUID needs to be manually initialised for consistency. * Helper function for unit tests where the UUID needs to be manually initialised for consistency.

View File

@ -46,7 +46,9 @@ interface FungibleAsset<T> : OwnableState {
* A command stating that money has been withdrawn from the shared ledger and is now accounted for * A command stating that money has been withdrawn from the shared ledger and is now accounted for
* in some other way. * in some other way.
*/ */
interface Exit<T> : Commands { val amount: Amount<Issued<T>> } interface Exit<T> : Commands {
val amount: Amount<Issued<T>>
}
} }
} }

View File

@ -154,6 +154,7 @@ data class TransactionState<out T : ContractState>(
/** Wraps the [ContractState] in a [TransactionState] object */ /** Wraps the [ContractState] in a [TransactionState] object */
infix fun <T : ContractState> T.`with notary`(newNotary: Party) = withNotary(newNotary) infix fun <T : ContractState> T.`with notary`(newNotary: Party) = withNotary(newNotary)
infix fun <T : ContractState> T.withNotary(newNotary: Party) = TransactionState(this, newNotary) infix fun <T : ContractState> T.withNotary(newNotary: Party) = TransactionState(this, newNotary)
/** /**

View File

@ -58,8 +58,7 @@ sealed class TransactionType {
// are any inputs, all outputs must have the same notary. // are any inputs, all outputs must have the same notary.
// TODO: Is that the correct set of restrictions? May need to come back to this, see if we can be more // TODO: Is that the correct set of restrictions? May need to come back to this, see if we can be more
// flexible on output notaries. // flexible on output notaries.
if (tx.notary != null if (tx.notary != null && tx.inputs.isNotEmpty()) {
&& tx.inputs.isNotEmpty()) {
tx.outputs.forEach { tx.outputs.forEach {
if (it.notary != tx.notary) { if (it.notary != tx.notary) {
throw TransactionVerificationException.NotaryChangeInWrongTransactionType(tx, it.notary) throw TransactionVerificationException.NotaryChangeInWrongTransactionType(tx, it.notary)
@ -82,8 +81,10 @@ sealed class TransactionType {
// Validate that all encumbrances exist within the set of input states. // Validate that all encumbrances exist within the set of input states.
tx.inputs.filter { it.state.data.encumbrance != null }.forEach { tx.inputs.filter { it.state.data.encumbrance != null }.forEach {
encumberedInput -> encumberedInput ->
if (tx.inputs.none { it.ref.txhash == encumberedInput.ref.txhash && if (tx.inputs.none {
it.ref.index == encumberedInput.state.data.encumbrance }) { it.ref.txhash == encumberedInput.ref.txhash &&
it.ref.index == encumberedInput.state.data.encumbrance
}) {
throw TransactionVerificationException.TransactionMissingEncumbranceException( throw TransactionVerificationException.TransactionMissingEncumbranceException(
tx, encumberedInput.state.data.encumbrance!!, tx, encumberedInput.state.data.encumbrance!!,
TransactionVerificationException.Direction.INPUT TransactionVerificationException.Direction.INPUT

View File

@ -88,6 +88,7 @@ data class TransactionForContract(val inputs: List<ContractState>,
class TransactionResolutionException(val hash: SecureHash) : Exception() { class TransactionResolutionException(val hash: SecureHash) : Exception() {
override fun toString() = "Transaction resolution failure for $hash" override fun toString() = "Transaction resolution failure for $hash"
} }
class TransactionConflictException(val conflictRef: StateRef, val tx1: LedgerTransaction, val tx2: LedgerTransaction) : Exception() class TransactionConflictException(val conflictRef: StateRef, val tx1: LedgerTransaction, val tx2: LedgerTransaction) : Exception()
sealed class TransactionVerificationException(val tx: LedgerTransaction, cause: Throwable?) : Exception(cause) { sealed class TransactionVerificationException(val tx: LedgerTransaction, cause: Throwable?) : Exception(cause) {
@ -96,14 +97,17 @@ sealed class TransactionVerificationException(val tx: LedgerTransaction, cause:
class SignersMissing(tx: LedgerTransaction, val missing: List<CompositeKey>) : TransactionVerificationException(tx, null) { class SignersMissing(tx: LedgerTransaction, val missing: List<CompositeKey>) : TransactionVerificationException(tx, null) {
override fun toString() = "Signers missing: ${missing.joinToString()}" override fun toString() = "Signers missing: ${missing.joinToString()}"
} }
class InvalidNotaryChange(tx: LedgerTransaction) : TransactionVerificationException(tx, null) class InvalidNotaryChange(tx: LedgerTransaction) : TransactionVerificationException(tx, null)
class NotaryChangeInWrongTransactionType(tx: LedgerTransaction, val outputNotary: Party) : TransactionVerificationException(tx, null) { class NotaryChangeInWrongTransactionType(tx: LedgerTransaction, val outputNotary: Party) : TransactionVerificationException(tx, null) {
override fun toString(): String = "Found unexpected notary change in transaction. Tx notary: ${tx.notary}, found: ${outputNotary}" override fun toString(): String = "Found unexpected notary change in transaction. Tx notary: ${tx.notary}, found: ${outputNotary}"
} }
class TransactionMissingEncumbranceException(tx: LedgerTransaction, val missing: Int, val inOut: Direction) : TransactionVerificationException(tx, null) { class TransactionMissingEncumbranceException(tx: LedgerTransaction, val missing: Int, val inOut: Direction) : TransactionVerificationException(tx, null) {
override val message: String? override val message: String?
get() = "Missing required encumbrance ${missing} in ${inOut}" get() = "Missing required encumbrance ${missing} in ${inOut}"
} }
enum class Direction { enum class Direction {
INPUT, INPUT,
OUTPUT OUTPUT

View File

@ -1,7 +1,11 @@
@file:JvmName("ClauseVerifier") @file:JvmName("ClauseVerifier")
package net.corda.core.contracts.clauses package net.corda.core.contracts.clauses
import net.corda.core.contracts.* import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract
/** /**
* Verify a transaction against the given list of clauses. * Verify a transaction against the given list of clauses.

View File

@ -10,8 +10,10 @@ import net.corda.core.contracts.ContractState
abstract class CompositeClause<in S : ContractState, C : CommandData, in K : Any> : Clause<S, C, K>() { abstract class CompositeClause<in S : ContractState, C : CommandData, in K : Any> : Clause<S, C, K>() {
/** List of clauses under this composite clause */ /** List of clauses under this composite clause */
abstract val clauses: List<Clause<S, C, K>> abstract val clauses: List<Clause<S, C, K>>
override fun getExecutionPath(commands: List<AuthenticatedObject<C>>): List<Clause<*, *, *>> override fun getExecutionPath(commands: List<AuthenticatedObject<C>>): List<Clause<*, *, *>>
= matchedClauses(commands).flatMap { it.getExecutionPath(commands) } = matchedClauses(commands).flatMap { it.getExecutionPath(commands) }
/** Determine which clauses are matched by the supplied commands */ /** Determine which clauses are matched by the supplied commands */
abstract fun matchedClauses(commands: List<AuthenticatedObject<C>>): List<Clause<S, C, K>> abstract fun matchedClauses(commands: List<AuthenticatedObject<C>>): List<Clause<S, C, K>>
} }

View File

@ -75,6 +75,7 @@ interface ServiceHub {
val notaryIdentityKey: KeyPair get() = this.keyManagementService.toKeyPair(this.myInfo.notaryIdentity.owningKey.keys) val notaryIdentityKey: KeyPair get() = this.keyManagementService.toKeyPair(this.myInfo.notaryIdentity.owningKey.keys)
} }
/** /**
* Given some [SignedTransaction]s, writes them to the local storage for validated transactions and then * Given some [SignedTransaction]s, writes them to the local storage for validated transactions and then
* sends them to the vault for further processing. * sends them to the vault for further processing.

View File

@ -206,8 +206,7 @@ inline fun <T> Kryo.useClassLoader(cl: ClassLoader, body: () -> T) : T {
this.classLoader = cl this.classLoader = cl
try { try {
return body() return body()
} } finally {
finally {
this.classLoader = tmp this.classLoader = tmp
} }
} }
@ -333,6 +332,7 @@ fun createKryo(k: Kryo = Kryo()): Kryo {
register(Kryo::class.java, object : Serializer<Kryo>() { register(Kryo::class.java, object : Serializer<Kryo>() {
override fun write(kryo: Kryo, output: Output, obj: Kryo) { override fun write(kryo: Kryo, output: Output, obj: Kryo) {
} }
override fun read(kryo: Kryo, input: Input, type: Class<Kryo>): Kryo { override fun read(kryo: Kryo, input: Input, type: Class<Kryo>): Kryo {
return createKryo((Fiber.getFiberSerializer() as KryoSerializer).kryo) return createKryo((Fiber.getFiberSerializer() as KryoSerializer).kryo)
} }
@ -412,8 +412,7 @@ object ReferencesAwareJavaSerializer : JavaSerializer() {
override fun write(kryo: Kryo, output: Output, obj: Any) { override fun write(kryo: Kryo, output: Output, obj: Any) {
if (kryo.references) { if (kryo.references) {
super.write(kryo, output, obj) super.write(kryo, output, obj)
} } else {
else {
ObjectOutputStream(output).use { ObjectOutputStream(output).use {
it.writeObject(obj) it.writeObject(obj)
} }
@ -423,8 +422,7 @@ object ReferencesAwareJavaSerializer : JavaSerializer() {
override fun read(kryo: Kryo, input: Input, type: Class<Any>): Any { override fun read(kryo: Kryo, input: Input, type: Class<Any>): Any {
return if (kryo.references) { return if (kryo.references) {
super.read(kryo, input, type) super.read(kryo, input, type)
} } else {
else {
ObjectInputStream(input).use(ObjectInputStream::readObject) ObjectInputStream(input).use(ObjectInputStream::readObject)
} }
} }

View File

@ -94,6 +94,7 @@ class CurrencyGenerator() : Generator<Currency>(Currency::class.java) {
companion object { companion object {
val currencies = Currency.getAvailableCurrencies().toList() val currencies = Currency.getAvailableCurrencies().toList()
} }
override fun generate(random: SourceOfRandomness, status: GenerationStatus): Currency { override fun generate(random: SourceOfRandomness, status: GenerationStatus): Currency {
return currencies[random.nextInt(0, currencies.size - 1)] return currencies[random.nextInt(0, currencies.size - 1)]
} }

View File

@ -31,7 +31,9 @@ class LedgerTransaction(
timestamp: Timestamp?, timestamp: Timestamp?,
type: TransactionType type: TransactionType
) : BaseTransaction(inputs, outputs, notary, signers, type, timestamp) { ) : BaseTransaction(inputs, outputs, notary, signers, type, timestamp) {
init { checkInvariants() } init {
checkInvariants()
}
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
fun <T : ContractState> outRef(index: Int) = StateAndRef(outputs[index] as TransactionState<T>, StateRef(id, index)) fun <T : ContractState> outRef(index: Int) = StateAndRef(outputs[index] as TransactionState<T>, StateRef(id, index))

View File

@ -84,9 +84,9 @@ sealed class MerkleTree(val hash: SecureHash) {
while (i < lastNodesList.size) { while (i < lastNodesList.size) {
val left = lastNodesList[i] val left = lastNodesList[i]
val n = lastNodesList.size val n = lastNodesList.size
val right = when {
// If there is an odd number of elements at this level, // If there is an odd number of elements at this level,
// the last element is hashed with itself and stored as a Leaf. // the last element is hashed with itself and stored as a Leaf.
val right = when {
i + 1 > n - 1 -> MerkleTree.DuplicatedLeaf(lastNodesList[n - 1].hash) i + 1 > n - 1 -> MerkleTree.DuplicatedLeaf(lastNodesList[n - 1].hash)
else -> lastNodesList[i + 1] else -> lastNodesList[i + 1]
} }

View File

@ -110,11 +110,13 @@ data class SignedTransaction(val txBits: SerializedBytes<WireTransaction>,
/** Returns the same transaction but with an additional (unchecked) signature. */ /** Returns the same transaction but with an additional (unchecked) signature. */
fun withAdditionalSignature(sig: DigitalSignature.WithKey) = copy(sigs = sigs + sig) fun withAdditionalSignature(sig: DigitalSignature.WithKey) = copy(sigs = sigs + sig)
/** Returns the same transaction but with an additional (unchecked) signatures. */ /** Returns the same transaction but with an additional (unchecked) signatures. */
fun withAdditionalSignatures(sigList: Iterable<DigitalSignature.WithKey>) = copy(sigs = sigs + sigList) fun withAdditionalSignatures(sigList: Iterable<DigitalSignature.WithKey>) = copy(sigs = sigs + sigList)
/** Alias for [withAdditionalSignature] to let you use Kotlin operator overloading. */ /** Alias for [withAdditionalSignature] to let you use Kotlin operator overloading. */
operator fun plus(sig: DigitalSignature.WithKey) = withAdditionalSignature(sig) operator fun plus(sig: DigitalSignature.WithKey) = withAdditionalSignature(sig)
/** Alias for [withAdditionalSignatures] to let you use Kotlin operator overloading. */ /** Alias for [withAdditionalSignatures] to let you use Kotlin operator overloading. */
operator fun plus(sigList: Collection<DigitalSignature.WithKey>) = withAdditionalSignatures(sigList) operator fun plus(sigList: Collection<DigitalSignature.WithKey>) = withAdditionalSignatures(sigList)

View File

@ -63,8 +63,7 @@ open class TransactionBuilder(
* collaborating parties may therefore require a higher time tolerance than a transaction being built by a single * collaborating parties may therefore require a higher time tolerance than a transaction being built by a single
* node. * node.
*/ */
fun setTime(time: Instant, timeTolerance: Duration) fun setTime(time: Instant, timeTolerance: Duration) = setTime(Timestamp(time, timeTolerance))
= setTime(Timestamp(time, timeTolerance))
fun setTime(newTimestamp: Timestamp) { fun setTime(newTimestamp: Timestamp) {
check(notary != null) { "Only notarised transactions can have a timestamp" } check(notary != null) { "Only notarised transactions can have a timestamp" }

View File

@ -34,7 +34,9 @@ class WireTransaction(
type: TransactionType, type: TransactionType,
timestamp: Timestamp? timestamp: Timestamp?
) : BaseTransaction(inputs, outputs, notary, signers, type, timestamp) { ) : BaseTransaction(inputs, outputs, notary, signers, type, timestamp) {
init { checkInvariants() } init {
checkInvariants()
}
// Cache the serialised form of the transaction and its hash to give us fast access to it. // Cache the serialised form of the transaction and its hash to give us fast access to it.
@Volatile @Transient private var cachedBytes: SerializedBytes<WireTransaction>? = null @Volatile @Transient private var cachedBytes: SerializedBytes<WireTransaction>? = null

View File

@ -13,8 +13,13 @@ import kotlin.reflect.KClass
// logging at that level is enabled. // logging at that level is enabled.
inline fun <reified T : Any> loggerFor(): org.slf4j.Logger = LoggerFactory.getLogger(T::class.java) inline fun <reified T : Any> loggerFor(): org.slf4j.Logger = LoggerFactory.getLogger(T::class.java)
inline fun org.slf4j.Logger.trace(msg: () -> String) { if (isTraceEnabled) trace(msg()) } inline fun org.slf4j.Logger.trace(msg: () -> String) {
inline fun org.slf4j.Logger.debug(msg: () -> String) { if (isDebugEnabled) debug(msg()) } if (isTraceEnabled) trace(msg())
}
inline fun org.slf4j.Logger.debug(msg: () -> String) {
if (isDebugEnabled) debug(msg())
}
/** A configuration helper that allows modifying the log level for specific loggers */ /** A configuration helper that allows modifying the log level for specific loggers */
object LogHelper { object LogHelper {

View File

@ -109,7 +109,9 @@ object NonEmptySetSerializer : Serializer<NonEmptySet<Any>>() {
// Read the first item and use it to construct the NonEmptySet // Read the first item and use it to construct the NonEmptySet
val set = NonEmptySet(first) val set = NonEmptySet(first)
// Read in the rest of the set // Read in the rest of the set
for (i in 2..size) { set.add(kryo.readClassAndObject(input)) } for (i in 2..size) {
set.add(kryo.readClassAndObject(input))
}
return set return set
} }
} }

View File

@ -80,7 +80,9 @@ class ProgressTracker(vararg steps: Step) {
// This field won't be serialized. // This field won't be serialized.
private val _changes by TransientProperty { PublishSubject.create<Change>() } private val _changes by TransientProperty { PublishSubject.create<Change>() }
private data class Child(val tracker: ProgressTracker, @Transient val subscription: Subscription?) private data class Child(val tracker: ProgressTracker, @Transient val subscription: Subscription?)
private val childProgressTrackers = HashMap<Step, Child>() private val childProgressTrackers = HashMap<Step, Child>()
init { init {
@ -151,8 +153,8 @@ class ProgressTracker(vararg steps: Step) {
var parent: ProgressTracker? = null var parent: ProgressTracker? = null
private set private set
@Suppress("unused") // TODO: Review by EOY2016 if this property is useful anywhere.
/** Walks up the tree to find the top level tracker. If this is the top level tracker, returns 'this' */ /** Walks up the tree to find the top level tracker. If this is the top level tracker, returns 'this' */
@Suppress("unused") // TODO: Review by EOY2016 if this property is useful anywhere.
val topLevelTracker: ProgressTracker val topLevelTracker: ProgressTracker
get() { get() {
var cursor: ProgressTracker = this var cursor: ProgressTracker = this

View File

@ -1,4 +1,5 @@
@file:JvmName("TestConstants") @file:JvmName("TestConstants")
package net.corda.core.utilities package net.corda.core.utilities
import net.corda.core.crypto.* import net.corda.core.crypto.*

View File

@ -1,11 +1,8 @@
package net.corda.core.flows; package net.corda.core.flows;
import org.junit.Test; import org.junit.*;
import java.util.HashMap; import java.util.*;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class FlowLogicRefFromJavaTest { public class FlowLogicRefFromJavaTest {

View File

@ -2,13 +2,11 @@ package net.corda.core.contracts.clauses
import net.corda.core.contracts.AuthenticatedObject import net.corda.core.contracts.AuthenticatedObject
import net.corda.core.contracts.CommandData import net.corda.core.contracts.CommandData
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.TransactionForContract import net.corda.core.contracts.TransactionForContract
import net.corda.core.crypto.SecureHash import net.corda.core.crypto.SecureHash
import org.junit.Test import org.junit.Test
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
import kotlin.test.assertEquals import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
class AnyCompositionTests { class AnyCompositionTests {
@Test @Test

View File

@ -1,15 +1,17 @@
package net.corda.core.crypto package net.corda.core.crypto
import com.esotericsoftware.kryo.serializers.MapSerializer import com.esotericsoftware.kryo.serializers.MapSerializer
import net.corda.contracts.asset.* import net.corda.contracts.asset.Cash
import net.corda.core.contracts.DOLLARS import net.corda.core.contracts.DOLLARS
import net.corda.core.contracts.`issued by` import net.corda.core.contracts.`issued by`
import net.corda.core.serialization.* import net.corda.core.serialization.*
import net.corda.core.transactions.* import net.corda.core.transactions.*
import net.corda.core.utilities.DUMMY_PUBKEY_1 import net.corda.core.utilities.DUMMY_PUBKEY_1
import net.corda.testing.* import net.corda.testing.ALICE_PUBKEY
import net.corda.testing.MEGA_CORP
import net.corda.testing.MEGA_CORP_PUBKEY
import net.corda.testing.ledger
import org.junit.Test import org.junit.Test
import java.util.* import java.util.*
import kotlin.test.assertEquals import kotlin.test.assertEquals

View File

@ -35,6 +35,7 @@ class TransactionSerializationTests {
override fun withNewOwner(newOwner: CompositeKey) = Pair(Commands.Move(), copy(owner = newOwner)) override fun withNewOwner(newOwner: CompositeKey) = Pair(Commands.Move(), copy(owner = newOwner))
} }
interface Commands : CommandData { interface Commands : CommandData {
class Move() : TypeOnlyCommandData(), Commands class Move() : TypeOnlyCommandData(), Commands
} }

View File

@ -21,6 +21,7 @@ class ProgressTrackerTest {
fun tracker() = ProgressTracker(ONE, TWO, THREE, FOUR) fun tracker() = ProgressTracker(ONE, TWO, THREE, FOUR)
} }
object ChildSteps { object ChildSteps {
object AYY : ProgressTracker.Step("ayy") object AYY : ProgressTracker.Step("ayy")
object BEE : ProgressTracker.Step("bee") object BEE : ProgressTracker.Step("bee")
@ -104,6 +105,7 @@ class ProgressTrackerTest {
println("bar") println("bar")
} }
} }
val kryo = createKryo().apply { val kryo = createKryo().apply {
// This is required to make sure Kryo walks through the auto-generated members for the lambda below. // This is required to make sure Kryo walks through the auto-generated members for the lambda below.
fieldSerializerConfig.isIgnoreSyntheticFields = false fieldSerializerConfig.isIgnoreSyntheticFields = false
@ -111,6 +113,7 @@ class ProgressTrackerTest {
pt.setChildProgressTracker(SimpleSteps.TWO, pt2) pt.setChildProgressTracker(SimpleSteps.TWO, pt2)
class Tmp { class Tmp {
val unserializable = Unserializable() val unserializable = Unserializable()
init { init {
pt2.changes.subscribe { unserializable.foo() } pt2.changes.subscribe { unserializable.foo() }
} }

View File

@ -1,13 +1,10 @@
package net.corda.contracts; package net.corda.contracts;
import net.corda.core.contracts.Amount; import net.corda.core.contracts.*;
import net.corda.core.contracts.ContractState; import net.corda.core.crypto.*;
import net.corda.core.contracts.Issued;
import net.corda.core.contracts.PartyAndReference;
import net.corda.core.crypto.CompositeKey;
import java.time.Instant; import java.time.*;
import java.util.Currency; import java.util.*;
/* This is an interface solely created to demonstrate that the same kotlin tests can be run against /* This is an interface solely created to demonstrate that the same kotlin tests can be run against
* either a Java implementation of the CommercialPaper or a kotlin implementation. * either a Java implementation of the CommercialPaper or a kotlin implementation.

View File

@ -1,34 +1,22 @@
package net.corda.contracts; package net.corda.contracts;
import com.google.common.collect.ImmutableList; import com.google.common.collect.*;
import kotlin.Pair; import kotlin.*;
import kotlin.Unit; import net.corda.contracts.asset.*;
import net.corda.contracts.asset.CashKt;
import net.corda.core.contracts.*; import net.corda.core.contracts.*;
import net.corda.core.contracts.TransactionForContract.InOutGroup; import net.corda.core.contracts.TransactionForContract.*;
import net.corda.core.contracts.clauses.AnyComposition; import net.corda.core.contracts.clauses.*;
import net.corda.core.contracts.clauses.Clause; import net.corda.core.crypto.*;
import net.corda.core.contracts.clauses.ClauseVerifier; import net.corda.core.node.services.*;
import net.corda.core.contracts.clauses.GroupClauseVerifier; import net.corda.core.transactions.*;
import net.corda.core.crypto.CompositeKey; import org.jetbrains.annotations.*;
import net.corda.core.crypto.CryptoUtilitiesKt;
import net.corda.core.crypto.Party;
import net.corda.core.crypto.SecureHash;
import net.corda.core.node.services.VaultService;
import net.corda.core.transactions.TransactionBuilder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.time.Instant; import java.time.*;
import java.util.Collections; import java.util.*;
import java.util.Currency; import java.util.stream.*;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import static kotlin.collections.CollectionsKt.single; import static kotlin.collections.CollectionsKt.*;
import static net.corda.core.contracts.ContractsDSL.requireSingleCommand; import static net.corda.core.contracts.ContractsDSL.*;
import static net.corda.core.contracts.ContractsDSL.requireThat;
/** /**
@ -274,17 +262,23 @@ public class JavaCommercialPaper implements Contract {
public interface Commands extends CommandData { public interface Commands extends CommandData {
class Move implements Commands { class Move implements Commands {
@Override @Override
public boolean equals(Object obj) { return obj instanceof Move; } public boolean equals(Object obj) {
return obj instanceof Move;
}
} }
class Redeem implements Commands { class Redeem implements Commands {
@Override @Override
public boolean equals(Object obj) { return obj instanceof Redeem; } public boolean equals(Object obj) {
return obj instanceof Redeem;
}
} }
class Issue implements Commands { class Issue implements Commands {
@Override @Override
public boolean equals(Object obj) { return obj instanceof Issue; } public boolean equals(Object obj) {
return obj instanceof Issue;
}
} }
} }

View File

@ -161,6 +161,7 @@ class Cash : OnLedgerAsset<Currency, Cash.Commands, Cash.State>() {
override fun deriveState(txState: TransactionState<State>, amount: Amount<Issued<Currency>>, owner: CompositeKey) override fun deriveState(txState: TransactionState<State>, amount: Amount<Issued<Currency>>, owner: CompositeKey)
= txState.copy(data = txState.data.copy(amount = amount, owner = owner)) = txState.copy(data = txState.data.copy(amount = amount, owner = owner))
override fun generateExitCommand(amount: Amount<Issued<Currency>>) = Commands.Exit(amount) override fun generateExitCommand(amount: Amount<Issued<Currency>>) = Commands.Exit(amount)
override fun generateIssueCommand() = Commands.Issue() override fun generateIssueCommand() = Commands.Issue()
override fun generateMoveCommand() = Commands.Move() override fun generateMoveCommand() = Commands.Move()

View File

@ -21,7 +21,6 @@ import java.util.*
// Just a fake program identifier for now. In a real system it could be, for instance, the hash of the program bytecode. // Just a fake program identifier for now. In a real system it could be, for instance, the hash of the program bytecode.
val COMMODITY_PROGRAM_ID = CommodityContract() val COMMODITY_PROGRAM_ID = CommodityContract()
//SecureHash.sha256("commodity")
/** /**
* A commodity contract represents an amount of some commodity, tracked on a distributed ledger. The design of this * A commodity contract represents an amount of some commodity, tracked on a distributed ledger. The design of this
@ -135,8 +134,10 @@ class CommodityContract : OnLedgerAsset<Commodity, CommodityContract.Commands, C
*/ */
data class Exit(override val amount: Amount<Issued<Commodity>>) : Commands, FungibleAsset.Commands.Exit<Commodity> data class Exit(override val amount: Amount<Issued<Commodity>>) : Commands, FungibleAsset.Commands.Exit<Commodity>
} }
override fun verify(tx: TransactionForContract) override fun verify(tx: TransactionForContract)
= verifyClause(tx, Clauses.Group(), extractCommands(tx.commands)) = verifyClause(tx, Clauses.Group(), extractCommands(tx.commands))
override fun extractCommands(commands: Collection<AuthenticatedObject<CommandData>>): List<AuthenticatedObject<Commands>> override fun extractCommands(commands: Collection<AuthenticatedObject<CommandData>>): List<AuthenticatedObject<Commands>>
= commands.select<CommodityContract.Commands>() = commands.select<CommodityContract.Commands>()
@ -160,6 +161,7 @@ class CommodityContract : OnLedgerAsset<Commodity, CommodityContract.Commands, C
override fun deriveState(txState: TransactionState<State>, amount: Amount<Issued<Commodity>>, owner: CompositeKey) override fun deriveState(txState: TransactionState<State>, amount: Amount<Issued<Commodity>>, owner: CompositeKey)
= txState.copy(data = txState.data.copy(amount = amount, owner = owner)) = txState.copy(data = txState.data.copy(amount = amount, owner = owner))
override fun generateExitCommand(amount: Amount<Issued<Commodity>>) = Commands.Exit(amount) override fun generateExitCommand(amount: Amount<Issued<Commodity>>) = Commands.Exit(amount)
override fun generateIssueCommand() = Commands.Issue() override fun generateIssueCommand() = Commands.Issue()
override fun generateMoveCommand() = Commands.Move() override fun generateMoveCommand() = Commands.Move()

View File

@ -210,6 +210,7 @@ class Obligation<P> : Contract {
commands: List<AuthenticatedObject<C>>, commands: List<AuthenticatedObject<C>>,
groupingKey: T?): Set<C> groupingKey: T?): Set<C>
= verify(inputs.filterIsInstance<State<P>>(), outputs.filterIsInstance<State<P>>()) = verify(inputs.filterIsInstance<State<P>>(), outputs.filterIsInstance<State<P>>())
private fun verify(inputs: List<State<P>>, private fun verify(inputs: List<State<P>>,
outputs: List<State<P>>): Set<C> { outputs: List<State<P>>): Set<C> {
requireThat { requireThat {
@ -704,6 +705,7 @@ infix fun <T> Obligation.State<T>.`owned by`(owner: CompositeKey) = copy(benefic
infix fun <T> Obligation.State<T>.`issued by`(party: Party) = copy(obligor = party) infix fun <T> Obligation.State<T>.`issued by`(party: Party) = copy(obligor = party)
// For Java users: // For Java users:
@Suppress("unused") fun <T> Obligation.State<T>.ownedBy(owner: CompositeKey) = copy(beneficiary = owner) @Suppress("unused") fun <T> Obligation.State<T>.ownedBy(owner: CompositeKey) = copy(beneficiary = owner)
@Suppress("unused") fun <T> Obligation.State<T>.issuedBy(party: Party) = copy(obligor = party) @Suppress("unused") fun <T> Obligation.State<T>.issuedBy(party: Party) = copy(obligor = party)
/** A randomly generated key. */ /** A randomly generated key. */

View File

@ -1,6 +1,5 @@
package net.corda.contracts.clause package net.corda.contracts.clause
import net.corda.core.contracts.FungibleAsset
import net.corda.core.contracts.* import net.corda.core.contracts.*
import net.corda.core.contracts.clauses.Clause import net.corda.core.contracts.clauses.Clause

View File

@ -1,4 +1,5 @@
@file:JvmName("VaultFiller") @file:JvmName("VaultFiller")
package net.corda.contracts.testing package net.corda.contracts.testing
import net.corda.contracts.asset.Cash import net.corda.contracts.asset.Cash

View File

@ -1,8 +1,8 @@
package net.corda.contracts.asset; package net.corda.contracts.asset;
import kotlin.*;
import net.corda.core.contracts.*; import net.corda.core.contracts.*;
import net.corda.core.serialization.*; import net.corda.core.serialization.*;
import kotlin.*;
import org.junit.*; import org.junit.*;
import static net.corda.core.contracts.ContractsDSL.*; import static net.corda.core.contracts.ContractsDSL.*;

View File

@ -665,6 +665,7 @@ class ObligationTests {
} }
} }
@Test @Test
fun `exit multiple product obligations`() { fun `exit multiple product obligations`() {
// Multi-product case. // Multi-product case.

View File

@ -1,7 +1,7 @@
package net.corda.node.utilities package net.corda.node.utilities
import net.corda.testing.node.makeTestDataSourceProperties
import junit.framework.TestSuite import junit.framework.TestSuite
import net.corda.testing.node.makeTestDataSourceProperties
import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThat
import org.jetbrains.exposed.sql.Database import org.jetbrains.exposed.sql.Database
import org.jetbrains.exposed.sql.Transaction import org.jetbrains.exposed.sql.Transaction

View File

@ -2,12 +2,9 @@
// must also be in the default package. When using Kotlin there are a whole host of exceptions // must also be in the default package. When using Kotlin there are a whole host of exceptions
// trying to construct this from Capsule, so it is written in Java. // trying to construct this from Capsule, so it is written in Java.
import org.apache.commons.io.FilenameUtils; import java.io.*;
import java.nio.file.*;
import java.io.File; import java.util.*;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
public class CordaCaplet extends Capsule { public class CordaCaplet extends Capsule {

View File

@ -95,6 +95,7 @@ sealed class PortAllocation {
val portCounter = AtomicInteger(startingPort) val portCounter = AtomicInteger(startingPort)
override fun nextPort() = portCounter.andIncrement override fun nextPort() = portCounter.andIncrement
} }
class RandomFree() : PortAllocation() { class RandomFree() : PortAllocation() {
override fun nextPort(): Int { override fun nextPort(): Int {
return ServerSocket().use { return ServerSocket().use {
@ -233,6 +234,7 @@ open class DriverDSL(
val clients = LinkedList<NodeMessagingClient>() val clients = LinkedList<NodeMessagingClient>()
var localServer: ArtemisMessagingServer? = null var localServer: ArtemisMessagingServer? = null
} }
private val state = ThreadBox(State()) private val state = ThreadBox(State())
//TODO: remove this once we can bundle quasar properly. //TODO: remove this once we can bundle quasar properly.
@ -394,6 +396,7 @@ open class DriverDSL(
"Bob", "Bob",
"Bank" "Bank"
) )
fun <A> pickA(array: Array<A>): A = array[Math.abs(Random().nextInt()) % array.size] fun <A> pickA(array: Array<A>): A = array[Math.abs(Random().nextInt()) % array.size]
private fun startNode( private fun startNode(

View File

@ -41,6 +41,7 @@ class CordaRPCOpsImpl(
Pair(vault.states.toList(), updates) Pair(vault.states.toList(), updates)
} }
} }
override fun verifiedTransactions(): Pair<List<SignedTransaction>, Observable<SignedTransaction>> { override fun verifiedTransactions(): Pair<List<SignedTransaction>, Observable<SignedTransaction>> {
return databaseTransaction(database) { return databaseTransaction(database) {
services.storageService.validatedTransactions.track() services.storageService.validatedTransactions.track()

View File

@ -118,6 +118,7 @@ fun configureTestSSL(): NodeSSLConfiguration = object : NodeSSLConfiguration {
override val certificatesPath = Files.createTempDirectory("certs") override val certificatesPath = Files.createTempDirectory("certs")
override val keyStorePassword: String get() = "cordacadevpass" override val keyStorePassword: String get() = "cordacadevpass"
override val trustStorePassword: String get() = "trustpass" override val trustStorePassword: String get() = "trustpass"
init { init {
configureWithDevSSLCertificate() configureWithDevSSLCertificate()
} }

View File

@ -72,21 +72,25 @@ interface NetworkMapService {
val ifChangedSinceVersion: Int?, val ifChangedSinceVersion: Int?,
override val replyTo: SingleMessageRecipient, override val replyTo: SingleMessageRecipient,
override val sessionID: Long = random63BitValue()) : ServiceRequestMessage override val sessionID: Long = random63BitValue()) : ServiceRequestMessage
data class FetchMapResponse(val nodes: Collection<NodeRegistration>?, val version: Int) data class FetchMapResponse(val nodes: Collection<NodeRegistration>?, val version: Int)
class QueryIdentityRequest(val identity: Party, class QueryIdentityRequest(val identity: Party,
override val replyTo: SingleMessageRecipient, override val replyTo: SingleMessageRecipient,
override val sessionID: Long) : ServiceRequestMessage override val sessionID: Long) : ServiceRequestMessage
data class QueryIdentityResponse(val node: NodeInfo?) data class QueryIdentityResponse(val node: NodeInfo?)
class RegistrationRequest(val wireReg: WireNodeRegistration, class RegistrationRequest(val wireReg: WireNodeRegistration,
override val replyTo: SingleMessageRecipient, override val replyTo: SingleMessageRecipient,
override val sessionID: Long = random63BitValue()) : ServiceRequestMessage override val sessionID: Long = random63BitValue()) : ServiceRequestMessage
data class RegistrationResponse(val success: Boolean) data class RegistrationResponse(val success: Boolean)
class SubscribeRequest(val subscribe: Boolean, class SubscribeRequest(val subscribe: Boolean,
override val replyTo: SingleMessageRecipient, override val replyTo: SingleMessageRecipient,
override val sessionID: Long = random63BitValue()) : ServiceRequestMessage override val sessionID: Long = random63BitValue()) : ServiceRequestMessage
data class SubscribeResponse(val confirmed: Boolean) data class SubscribeResponse(val confirmed: Boolean)
data class Update(val wireReg: WireNodeRegistration, val mapVersion: Int, val replyTo: MessageRecipients) data class Update(val wireReg: WireNodeRegistration, val mapVersion: Int, val replyTo: MessageRecipients)

View File

@ -3,9 +3,9 @@ package net.corda.node.services.persistence
import net.corda.core.ThreadBox import net.corda.core.ThreadBox
import net.corda.core.bufferUntilSubscribed import net.corda.core.bufferUntilSubscribed
import net.corda.core.crypto.SecureHash import net.corda.core.crypto.SecureHash
import net.corda.core.flows.StateMachineRunId
import net.corda.core.node.services.StateMachineRecordedTransactionMappingStorage import net.corda.core.node.services.StateMachineRecordedTransactionMappingStorage
import net.corda.core.node.services.StateMachineTransactionMapping import net.corda.core.node.services.StateMachineTransactionMapping
import net.corda.core.flows.StateMachineRunId
import rx.Observable import rx.Observable
import rx.subjects.PublishSubject import rx.subjects.PublishSubject
import java.util.* import java.util.*

View File

@ -1,5 +1,6 @@
package net.corda.node.services.schema package net.corda.node.services.schema
import kotlinx.support.jdk7.use
import net.corda.core.contracts.ContractState import net.corda.core.contracts.ContractState
import net.corda.core.contracts.StateAndRef import net.corda.core.contracts.StateAndRef
import net.corda.core.contracts.StateRef import net.corda.core.contracts.StateRef
@ -9,7 +10,6 @@ import net.corda.core.schemas.QueryableState
import net.corda.core.utilities.debug import net.corda.core.utilities.debug
import net.corda.core.utilities.loggerFor import net.corda.core.utilities.loggerFor
import net.corda.node.services.api.ServiceHubInternal import net.corda.node.services.api.ServiceHubInternal
import kotlinx.support.jdk7.use
import org.hibernate.SessionFactory import org.hibernate.SessionFactory
import org.hibernate.boot.model.naming.Identifier import org.hibernate.boot.model.naming.Identifier
import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

View File

@ -139,6 +139,7 @@ class StrandLocalTransactionManager(initWithDatabase: Database) : TransactionMan
// Composite columns for use with below Exposed helpers. // Composite columns for use with below Exposed helpers.
data class PartyColumns(val name: Column<String>, val owningKey: Column<CompositeKey>) data class PartyColumns(val name: Column<String>, val owningKey: Column<CompositeKey>)
data class StateRefColumns(val txId: Column<SecureHash>, val index: Column<Int>) data class StateRefColumns(val txId: Column<SecureHash>, val index: Column<Int>)
data class TxnNoteColumns(val txId: Column<SecureHash>, val note: Column<String>) data class TxnNoteColumns(val txId: Column<SecureHash>, val note: Column<String>)

View File

@ -1,5 +1,6 @@
package net.corda.node.utilities.certsigning package net.corda.node.utilities.certsigning
import joptsimple.OptionParser
import net.corda.core.* import net.corda.core.*
import net.corda.core.crypto.X509Utilities import net.corda.core.crypto.X509Utilities
import net.corda.core.crypto.X509Utilities.CORDA_CLIENT_CA import net.corda.core.crypto.X509Utilities.CORDA_CLIENT_CA
@ -12,7 +13,6 @@ import net.corda.node.services.config.ConfigHelper
import net.corda.node.services.config.FullNodeConfiguration import net.corda.node.services.config.FullNodeConfiguration
import net.corda.node.services.config.NodeConfiguration import net.corda.node.services.config.NodeConfiguration
import net.corda.node.services.config.getValue import net.corda.node.services.config.getValue
import joptsimple.OptionParser
import java.net.URL import java.net.URL
import java.nio.file.Paths import java.nio.file.Paths
import java.security.KeyPair import java.security.KeyPair

View File

@ -6,6 +6,7 @@ import java.security.cert.Certificate
interface CertificateSigningService { interface CertificateSigningService {
/** Submits a CSR to the signing service and returns an opaque request ID. */ /** Submits a CSR to the signing service and returns an opaque request ID. */
fun submitRequest(request: PKCS10CertificationRequest): String fun submitRequest(request: PKCS10CertificationRequest): String
/** Poll Certificate Signing Server for the request and returns a chain of certificates if request has been approved, null otherwise. */ /** Poll Certificate Signing Server for the request and returns a chain of certificates if request has been approved, null otherwise. */
fun retrieveCertificates(requestId: String): Array<Certificate>? fun retrieveCertificates(requestId: String): Array<Certificate>?
} }

View File

@ -1,9 +1,8 @@
package net.corda.attachmentdemo package net.corda.attachmentdemo
import com.google.common.net.HostAndPort import com.google.common.net.HostAndPort
import net.corda.core.utilities.loggerFor
import net.corda.testing.http.HttpUtils
import joptsimple.OptionParser import joptsimple.OptionParser
import net.corda.core.utilities.loggerFor
import kotlin.system.exitProcess import kotlin.system.exitProcess
fun main(args: Array<String>) { fun main(args: Array<String>) {

View File

@ -1,4 +1,5 @@
@file:JvmName("IRSDemo") @file:JvmName("IRSDemo")
package net.corda.irs package net.corda.irs
import com.google.common.net.HostAndPort import com.google.common.net.HostAndPort

View File

@ -1,11 +1,9 @@
package net.corda.irs package net.corda.irs
import net.corda.core.node.services.ServiceInfo
import net.corda.irs.api.NodeInterestRates
import net.corda.node.driver.driver import net.corda.node.driver.driver
import net.corda.node.services.transactions.SimpleNotaryService import net.corda.node.services.transactions.SimpleNotaryService
import net.corda.core.node.services.ServiceInfo
import net.corda.irs.api.IRSDemoClientApi
import net.corda.irs.api.NodeInterestRates
import net.corda.testing.getHostAndPort
/** /**
* This file is exclusively for being able to run your nodes through an IDE (as opposed to running deployNodes) * This file is exclusively for being able to run your nodes through an IDE (as opposed to running deployNodes)

View File

@ -145,6 +145,7 @@ object NodeInterestRates {
} }
var container: FixContainer = FixContainer(fixes) var container: FixContainer = FixContainer(fixes)
} }
private val mutex = FiberBox(InnerState()) private val mutex = FiberBox(InnerState())
var knownFixes: FixContainer var knownFixes: FixContainer

View File

@ -52,6 +52,7 @@ open class Rate(val ratioUnit: RatioUnit? = null) {
* for equality. * for equality.
*/ */
override fun hashCode() = ratioUnit?.hashCode() ?: 0 override fun hashCode() = ratioUnit?.hashCode() ?: 0
override fun toString() = ratioUnit.toString() override fun toString() = ratioUnit.toString()
} }

View File

@ -73,6 +73,7 @@ object FixingFlow {
// TODO Could it be solved in better way, move filtering here not in RatesFixFlow? // TODO Could it be solved in better way, move filtering here not in RatesFixFlow?
// DOCSTART 1 // DOCSTART 1
fun filterCommands(c: Command) = oracleParty.owningKey in c.signers && c.value is Fix fun filterCommands(c: Command) = oracleParty.owningKey in c.signers && c.value is Fix
val filterFuns = FilterFuns(filterCommands = ::filterCommands) val filterFuns = FilterFuns(filterCommands = ::filterCommands)
val addFixing = object : RatesFixFlow(ptx, filterFuns, oracleParty, fixOf, BigDecimal.ZERO, BigDecimal.ONE) { val addFixing = object : RatesFixFlow(ptx, filterFuns, oracleParty, fixOf, BigDecimal.ZERO, BigDecimal.ONE) {
@Suspendable @Suspendable

View File

@ -28,7 +28,7 @@ import java.util.*
* @throws FixOutOfRange if the returned fix was further away from the expected rate by the given amount. * @throws FixOutOfRange if the returned fix was further away from the expected rate by the given amount.
*/ */
open class RatesFixFlow(protected val tx: TransactionBuilder, open class RatesFixFlow(protected val tx: TransactionBuilder,
// Filtering functions over transaction, used to build partial transaction presented to oracle. /** Filtering functions over transaction, used to build partial transaction presented to oracle. */
private val filterFuns: FilterFuns, private val filterFuns: FilterFuns,
private val oracle: Party, private val oracle: Party,
private val fixOf: FixOf, private val fixOf: FixOf,

View File

@ -71,7 +71,11 @@ class NetworkMapVisualiser : Application() {
viewModel.view = view viewModel.view = view
viewModel.presentationMode = "--presentation-mode" in parameters.raw viewModel.presentationMode = "--presentation-mode" in parameters.raw
buildScene(stage) buildScene(stage)
viewModel.displayStyle = if ("--circle" in parameters.raw) { Style.CIRCLE } else { viewModel.displayStyle } viewModel.displayStyle = if ("--circle" in parameters.raw) {
Style.CIRCLE
} else {
viewModel.displayStyle
}
val simulation = viewModel.simulation val simulation = viewModel.simulation
// Update the white-backgrounded label indicating what flow step it's up to. // Update the white-backgrounded label indicating what flow step it's up to.

View File

@ -1,8 +1,5 @@
package net.corda.netmap package net.corda.netmap
import net.corda.core.utilities.ProgressTracker
import net.corda.simulation.IRSSimulation
import net.corda.testing.node.MockNetwork
import javafx.animation.* import javafx.animation.*
import javafx.geometry.Pos import javafx.geometry.Pos
import javafx.scene.control.Label import javafx.scene.control.Label
@ -10,6 +7,9 @@ import javafx.scene.layout.StackPane
import javafx.scene.shape.Circle import javafx.scene.shape.Circle
import javafx.scene.shape.Line import javafx.scene.shape.Line
import javafx.util.Duration import javafx.util.Duration
import net.corda.core.utilities.ProgressTracker
import net.corda.simulation.IRSSimulation
import net.corda.testing.node.MockNetwork
import java.util.* import java.util.*
class VisualiserViewModel { class VisualiserViewModel {

View File

@ -1,15 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.geometry.*?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1"> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0"
prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1">
<children> <children>
<HBox alignment="CENTER_RIGHT" prefHeight="0.0" prefWidth="600.0"> <HBox alignment="CENTER_RIGHT" prefHeight="0.0" prefWidth="600.0">
<children> <children>
@ -22,7 +18,8 @@
<SplitPane dividerPositions="0.2408026755852843" prefHeight="336.0" prefWidth="600.0" VBox.vgrow="ALWAYS"> <SplitPane dividerPositions="0.2408026755852843" prefHeight="336.0" prefWidth="600.0" VBox.vgrow="ALWAYS">
<items> <items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"/> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"/>
<ScrollPane fx:id="mapView" hbarPolicy="NEVER" pannable="true" prefHeight="200.0" prefWidth="200.0" vbarPolicy="NEVER" /> <ScrollPane fx:id="mapView" hbarPolicy="NEVER" pannable="true" prefHeight="200.0" prefWidth="200.0"
vbarPolicy="NEVER"/>
</items> </items>
</SplitPane> </SplitPane>
</children> </children>

View File

@ -2,6 +2,7 @@
-fx-font-family: "Source Sans Pro", sans-serif; -fx-font-family: "Source Sans Pro", sans-serif;
-fx-font-size: 12pt; -fx-font-size: 12pt;
} }
.node-bank { .node-bank {
-base-fill: #9e7bff; -base-fill: #9e7bff;
} }
@ -124,6 +125,7 @@
-fx-base: lightblue; -fx-base: lightblue;
-fx-text-fill: darkslategrey; -fx-text-fill: darkslategrey;
} }
.blue-button:disabled { .blue-button:disabled {
-fx-text-fill: white; -fx-text-fill: white;
} }
@ -132,6 +134,7 @@
-fx-base: #62c462; -fx-base: #62c462;
-fx-text-fill: darkslategrey; -fx-text-fill: darkslategrey;
} }
.green-button:disabled { .green-button:disabled {
-fx-text-fill: white; -fx-text-fill: white;
} }
@ -173,10 +176,12 @@
.date-label { .date-label {
-fx-font-size: 30; -fx-font-size: 30;
} }
.splitter { .splitter {
-fx-padding: 0; -fx-padding: 0;
-fx-background-color: #464646; -fx-background-color: #464646;
} }
.splitter > .split-pane-divider { .splitter > .split-pane-divider {
-fx-background-color: linear-gradient(to left, #1c1c1c, transparent); -fx-background-color: linear-gradient(to left, #1c1c1c, transparent);
-fx-border-color: black; -fx-border-color: black;
@ -201,6 +206,7 @@
-fx-background-color: #666666; -fx-background-color: #666666;
-fx-padding: 5px; -fx-padding: 5px;
} }
.sidebar > VBox > StackPane > Label { .sidebar > VBox > StackPane > Label {
-fx-text-fill: white; -fx-text-fill: white;
} }
@ -209,6 +215,7 @@
-fx-spacing: 5; -fx-spacing: 5;
-fx-fill-width: true; -fx-fill-width: true;
} }
.progress-tracker-widget-steps > StackPane { .progress-tracker-widget-steps > StackPane {
-fx-background-color: #5a5a5a; -fx-background-color: #5a5a5a;
-fx-padding: 7px; -fx-padding: 7px;
@ -216,6 +223,7 @@
-fx-max-height: 35px; -fx-max-height: 35px;
-fx-min-height: 35px; -fx-min-height: 35px;
} }
.progress-tracker-widget-steps > StackPane > Label { .progress-tracker-widget-steps > StackPane > Label {
-fx-text-fill: white; -fx-text-fill: white;
} }

View File

@ -29,13 +29,13 @@ import com.opengamma.strata.product.common.BuySell
import com.opengamma.strata.product.swap.ResolvedSwapTrade import com.opengamma.strata.product.swap.ResolvedSwapTrade
import com.opengamma.strata.product.swap.SwapTrade import com.opengamma.strata.product.swap.SwapTrade
import com.opengamma.strata.product.swap.type.FixedIborSwapConventions import com.opengamma.strata.product.swap.type.FixedIborSwapConventions
import kotlinx.support.jdk8.collections.stream
import net.corda.core.serialization.deserialize import net.corda.core.serialization.deserialize
import net.corda.core.serialization.serialize import net.corda.core.serialization.serialize
import net.corda.vega.analytics.BimmAnalysisUtils import net.corda.vega.analytics.BimmAnalysisUtils
import net.corda.vega.analytics.IsdaConfiguration import net.corda.vega.analytics.IsdaConfiguration
import net.corda.vega.analytics.PortfolioNormalizer import net.corda.vega.analytics.PortfolioNormalizer
import net.corda.vega.analytics.RwamBimmNotProductClassesCalculator import net.corda.vega.analytics.RwamBimmNotProductClassesCalculator
import kotlinx.support.jdk8.collections.stream
import java.nio.file.Paths import java.nio.file.Paths
import java.time.LocalDate import java.time.LocalDate
import java.util.stream.Collectors.toList import java.util.stream.Collectors.toList

View File

@ -1,9 +1,9 @@
package net.corda.traderdemo package net.corda.traderdemo
import com.google.common.net.HostAndPort import com.google.common.net.HostAndPort
import joptsimple.OptionParser
import net.corda.core.contracts.DOLLARS import net.corda.core.contracts.DOLLARS
import net.corda.core.utilities.loggerFor import net.corda.core.utilities.loggerFor
import joptsimple.OptionParser
import org.slf4j.Logger import org.slf4j.Logger
import kotlin.system.exitProcess import kotlin.system.exitProcess

View File

@ -22,7 +22,9 @@ class ReportingCurrencyModel {
* exchange rates change * exchange rates change
*/ */
val reportingExchange: ObservableValue<Pair<Currency, (Amount<Currency>) -> Amount<Currency>>> = val reportingExchange: ObservableValue<Pair<Currency, (Amount<Currency>) -> Amount<Currency>>> =
EasyBind.map(AmountBindings.exchange(reportingCurrency, exchangeRate)) { Pair(it.first) { amount: Amount<Currency> -> EasyBind.map(AmountBindings.exchange(reportingCurrency, exchangeRate)) {
Pair(it.first) { amount: Amount<Currency> ->
Amount(it.second(amount), it.first) Amount(it.second(amount), it.first)
}} }
}
} }

View File

@ -1,10 +1,10 @@
package net.corda.explorer.ui package net.corda.explorer.ui
import net.corda.explorer.formatters.Formatter
import javafx.scene.Node import javafx.scene.Node
import javafx.scene.control.ListCell import javafx.scene.control.ListCell
import javafx.scene.control.ListView import javafx.scene.control.ListView
import javafx.util.Callback import javafx.util.Callback
import net.corda.explorer.formatters.Formatter
fun <T> Formatter<T>.toListCellFactory() = Callback<ListView<T?>, ListCell<T?>> { fun <T> Formatter<T>.toListCellFactory() = Callback<ListView<T?>, ListCell<T?>> {
object : ListCell<T?>() { object : ListCell<T?>() {
@ -25,6 +25,7 @@ fun <T> ListView<T>.setCustomCellFactory(toNode: (T) -> Node) {
init { init {
text = null text = null
} }
override fun updateItem(value: T?, empty: Boolean) { override fun updateItem(value: T?, empty: Boolean) {
super.updateItem(value, empty) super.updateItem(value, empty)
graphic = if (value != null && !empty) { graphic = if (value != null && !empty) {

View File

@ -1,6 +1,5 @@
package net.corda.explorer.ui package net.corda.explorer.ui
import net.corda.explorer.formatters.Formatter
import javafx.beans.binding.Bindings import javafx.beans.binding.Bindings
import javafx.beans.value.ObservableValue import javafx.beans.value.ObservableValue
import javafx.scene.Node import javafx.scene.Node
@ -8,6 +7,7 @@ import javafx.scene.control.TableCell
import javafx.scene.control.TableColumn import javafx.scene.control.TableColumn
import javafx.scene.control.TableView import javafx.scene.control.TableView
import javafx.util.Callback import javafx.util.Callback
import net.corda.explorer.formatters.Formatter
import org.fxmisc.easybind.EasyBind import org.fxmisc.easybind.EasyBind
fun <S> TableView<S>.setColumnPrefWidthPolicy( fun <S> TableView<S>.setColumnPrefWidthPolicy(
@ -62,6 +62,7 @@ fun <S, T> TableColumn<S, T>.setCustomCellFactory(toNode: (T) -> Node) {
init { init {
text = null text = null
} }
override fun updateItem(value: T?, empty: Boolean) { override fun updateItem(value: T?, empty: Boolean) {
super.updateItem(value, empty) super.updateItem(value, empty)
graphic = if (value != null && !empty) { graphic = if (value != null && !empty) {

View File

@ -1,12 +1,12 @@
package net.corda.explorer.ui package net.corda.explorer.ui
import net.corda.explorer.formatters.Formatter
import javafx.beans.binding.Bindings import javafx.beans.binding.Bindings
import javafx.beans.value.ObservableValue import javafx.beans.value.ObservableValue
import javafx.scene.control.TreeTableCell import javafx.scene.control.TreeTableCell
import javafx.scene.control.TreeTableColumn import javafx.scene.control.TreeTableColumn
import javafx.scene.control.TreeTableView import javafx.scene.control.TreeTableView
import javafx.util.Callback import javafx.util.Callback
import net.corda.explorer.formatters.Formatter
import org.fxmisc.easybind.EasyBind import org.fxmisc.easybind.EasyBind

View File

@ -8,6 +8,7 @@
-color-5: rgb(255, 191, 198); /* Corda logo highlight */ -color-5: rgb(255, 191, 198); /* Corda logo highlight */
-color-6: rgba(219, 0, 23, 0.2); /* Corda logo highlight */ -color-6: rgba(219, 0, 23, 0.2); /* Corda logo highlight */
} }
.root { .root {
-fx-background: #f4f4f4; -fx-background: #f4f4f4;
-fx-control-inner-background: white; -fx-control-inner-background: white;

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) --> <!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg id="svg15261" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="297mm" width="210mm" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 744.09448819 1052.3622047"> <svg id="svg15261" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg"
height="297mm" width="210mm" version="1.1" xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 744.09448819 1052.3622047">
<metadata id="metadata15266"> <metadata id="metadata15266">
<rdf:RDF> <rdf:RDF>
<cc:Work rdf:about=""> <cc:Work rdf:about="">
@ -13,8 +15,10 @@
<g id="layer1"> <g id="layer1">
<g id="g16332" transform="matrix(22.359 0 0 22.359 -19527 -23416)" fill="#1488cc"> <g id="g16332" transform="matrix(22.359 0 0 22.359 -19527 -23416)" fill="#1488cc">
<g id="g45283" fill="#1488cc"> <g id="g45283" fill="#1488cc">
<path id="path6608" d="m891.63 1061.7c0 2.0866-1.695 3.7802-3.7844 3.7802-2.0872 0-3.7822-1.6936-3.7822-3.7802 0-2.0906 1.695-3.7826 3.7822-3.7826 2.0894 0 3.7844 1.692 3.7844 3.7826"/> <path id="path6608"
<path id="path6610" d="m894.18 1076.1c0 2.4219-1.633 2.7474-3.6493 2.7474h-5.3908c-2.0119 0-3.6448-0.3255-3.6448-2.7474l1.0547-6.3223c0-2.02 1.3627-3.6582 3.0422-3.6582h4.4913c1.6795 0 3.04 1.6382 3.04 3.6582l1.0569 6.3223"/> d="m891.63 1061.7c0 2.0866-1.695 3.7802-3.7844 3.7802-2.0872 0-3.7822-1.6936-3.7822-3.7802 0-2.0906 1.695-3.7826 3.7822-3.7826 2.0894 0 3.7844 1.692 3.7844 3.7826"/>
<path id="path6610"
d="m894.18 1076.1c0 2.4219-1.633 2.7474-3.6493 2.7474h-5.3908c-2.0119 0-3.6448-0.3255-3.6448-2.7474l1.0547-6.3223c0-2.02 1.3627-3.6582 3.0422-3.6582h4.4913c1.6795 0 3.04 1.6382 3.04 3.6582l1.0569 6.3223"/>
</g> </g>
</g> </g>
</g> </g>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?> <?import de.jensd.fx.glyphs.fontawesome.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<GridPane styleClass="contractStateView" hgap="10" stylesheets="@../css/corda.css" vgap="10" xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1"> <GridPane styleClass="contractStateView" hgap="10" stylesheets="@../css/corda.css" vgap="10"
xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1">
<TitledPane fx:id="inputPane" collapsible="false" text="Input" GridPane.fillWidth="true"> <TitledPane fx:id="inputPane" collapsible="false" text="Input" GridPane.fillWidth="true">
<ListView fx:id="inputs"/> <ListView fx:id="inputs"/>
</TitledPane> </TitledPane>
@ -14,7 +15,8 @@
<ListView fx:id="outputs" maxWidth="Infinity"/> <ListView fx:id="outputs" maxWidth="Infinity"/>
</TitledPane> </TitledPane>
<TitledPane fx:id="signaturesPane" collapsible="false" text="Signatures" GridPane.columnSpan="3" GridPane.rowIndex="1"> <TitledPane fx:id="signaturesPane" collapsible="false" text="Signatures" GridPane.columnSpan="3"
GridPane.rowIndex="1">
<VBox fx:id="signatures" spacing="5"/> <VBox fx:id="signatures" spacing="5"/>
</TitledPane> </TitledPane>

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.*?>
<?import javafx.scene.control.ScrollPane?> <?import javafx.scene.layout.*?>
<?import javafx.scene.control.TitledPane?> <ScrollPane hbarPolicy="NEVER" fitToWidth="true" stylesheets="@../css/corda.css"
<?import javafx.scene.layout.TilePane?> xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1">
<ScrollPane hbarPolicy="NEVER" fitToWidth="true" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1">
<TilePane fx:id="tilePane" tileAlignment="TOP_LEFT"> <TilePane fx:id="tilePane" tileAlignment="TOP_LEFT">
<TitledPane fx:id="template" text="Template" collapsible="false" styleClass="tile"> <TitledPane fx:id="template" text="Template" collapsible="false" styleClass="tile">
<Label text="USD 186.7m" textAlignment="CENTER" wrapText="true"/> <Label text="USD 186.7m" textAlignment="CENTER" wrapText="true"/>

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<DialogPane styleClass="login" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1"> <DialogPane styleClass="login" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.112-ea"
xmlns:fx="http://javafx.com/fxml/1">
<padding> <padding>
<Insets bottom="30" left="50" right="50" top="10"/> <Insets bottom="30" left="50" right="50" top="10"/>
</padding> </padding>
@ -26,10 +27,12 @@
<TextField fx:id="portTextField" prefWidth="100" promptText="Port" GridPane.columnIndex="2"/> <TextField fx:id="portTextField" prefWidth="100" promptText="Port" GridPane.columnIndex="2"/>
<Label text="Username :" GridPane.rowIndex="1" GridPane.halignment="RIGHT"/> <Label text="Username :" GridPane.rowIndex="1" GridPane.halignment="RIGHT"/>
<TextField fx:id="usernameTextField" promptText="Username" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="1"/> <TextField fx:id="usernameTextField" promptText="Username" GridPane.columnIndex="1"
GridPane.columnSpan="2" GridPane.rowIndex="1"/>
<Label text="Password :" GridPane.rowIndex="2" GridPane.halignment="RIGHT"/> <Label text="Password :" GridPane.rowIndex="2" GridPane.halignment="RIGHT"/>
<PasswordField fx:id="passwordTextField" promptText="Password" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="2"/> <PasswordField fx:id="passwordTextField" promptText="Password" GridPane.columnIndex="1"
GridPane.columnSpan="2" GridPane.rowIndex="2"/>
<HBox spacing="20" GridPane.columnIndex="1" GridPane.rowIndex="3" GridPane.columnSpan="2"> <HBox spacing="20" GridPane.columnIndex="1" GridPane.rowIndex="3" GridPane.columnSpan="2">
<CheckBox fx:id="rememberMeCheckBox" text="Remember me"/> <CheckBox fx:id="rememberMeCheckBox" text="Remember me"/>

View File

@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?> <?import de.jensd.fx.glyphs.fontawesome.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<StackPane styleClass="mainView" stylesheets="@../css/corda.css" prefHeight="650" prefWidth="900" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1"> <StackPane styleClass="mainView" stylesheets="@../css/corda.css" prefHeight="650" prefWidth="900"
xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1">
<BorderPane maxHeight="Infinity"> <BorderPane maxHeight="Infinity">
<top> <top>
<GridPane styleClass="header" vgap="5"> <GridPane styleClass="header" vgap="5">
<!-- Corda logo --> <!-- Corda logo -->
<ImageView styleClass="corda-text-logo" fitHeight="35" preserveRatio="true" GridPane.hgrow="ALWAYS" fx:id="cordaLogo"/> <ImageView styleClass="corda-text-logo" fitHeight="35" preserveRatio="true" GridPane.hgrow="ALWAYS"
fx:id="cordaLogo"/>
<!-- User account menu --> <!-- User account menu -->
<MenuButton fx:id="userButton" mnemonicParsing="false" GridPane.columnIndex="3"> <MenuButton fx:id="userButton" mnemonicParsing="false" GridPane.columnIndex="3">
@ -30,8 +32,10 @@
<FontAwesomeIconView glyphName="CARET_LEFT" visible="false"/> <FontAwesomeIconView glyphName="CARET_LEFT" visible="false"/>
</StackPane> </StackPane>
<StackPane> <StackPane>
<Button fx:id="selectedTemplate" text="Selected" styleClass="sidebar-menu-item, sidebar-menu-item-selected"/> <Button fx:id="selectedTemplate" text="Selected"
<FontAwesomeIconView glyphName="CARET_LEFT" StackPane.alignment="CENTER_RIGHT" styleClass="sidebar-menu-item-arrow"/> styleClass="sidebar-menu-item, sidebar-menu-item-selected"/>
<FontAwesomeIconView glyphName="CARET_LEFT" StackPane.alignment="CENTER_RIGHT"
styleClass="sidebar-menu-item-arrow"/>
</StackPane> </StackPane>
</VBox> </VBox>
<BorderPane fx:id="selectionBorderPane"/> <BorderPane fx:id="selectionBorderPane"/>

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<BorderPane styleClass="networkView" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1"> <BorderPane styleClass="networkView" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.112-ea"
xmlns:fx="http://javafx.com/fxml/1">
<center> <center>
<StackPane> <StackPane>
<ScrollPane fx:id="mapScrollPane" hbarPolicy="ALWAYS" pannable="true" vbarPolicy="ALWAYS"> <ScrollPane fx:id="mapScrollPane" hbarPolicy="ALWAYS" pannable="true" vbarPolicy="ALWAYS">

View File

@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<DialogPane stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1"> <DialogPane stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea"
xmlns:fx="http://javafx.com/fxml/1">
<content> <content>
<GridPane hgap="10" vgap="10"> <GridPane hgap="10" vgap="10">
<!-- Row 0 --> <!-- Row 0 -->
<Label text="Transaction Type : " GridPane.halignment="RIGHT"/> <Label text="Transaction Type : " GridPane.halignment="RIGHT"/>
<ChoiceBox fx:id="transactionTypeCB" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.columnSpan="4" GridPane.hgrow="ALWAYS"/> <ChoiceBox fx:id="transactionTypeCB" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.columnSpan="4"
GridPane.hgrow="ALWAYS"/>
<!-- Row 1 --> <!-- Row 1 -->
<Label fx:id="partyALabel" GridPane.halignment="RIGHT" GridPane.rowIndex="1"/> <Label fx:id="partyALabel" GridPane.halignment="RIGHT" GridPane.rowIndex="1"/>
@ -16,7 +18,8 @@
<!-- Row 2 --> <!-- Row 2 -->
<Label fx:id="partyBLabel" GridPane.halignment="RIGHT" GridPane.rowIndex="2"/> <Label fx:id="partyBLabel" GridPane.halignment="RIGHT" GridPane.rowIndex="2"/>
<ChoiceBox fx:id="partyBChoiceBox" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.columnSpan="4" GridPane.fillWidth="true" GridPane.hgrow="ALWAYS" GridPane.rowIndex="2"/> <ChoiceBox fx:id="partyBChoiceBox" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.columnSpan="4"
GridPane.fillWidth="true" GridPane.hgrow="ALWAYS" GridPane.rowIndex="2"/>
<!-- Row 3 --> <!-- Row 3 -->
<Label fx:id="issuerLabel" text="Issuer : " GridPane.halignment="RIGHT" GridPane.rowIndex="3"/> <Label fx:id="issuerLabel" text="Issuer : " GridPane.halignment="RIGHT" GridPane.rowIndex="3"/>
@ -24,18 +27,21 @@
<ChoiceBox fx:id="issuerChoiceBox" maxWidth="Infinity"/> <ChoiceBox fx:id="issuerChoiceBox" maxWidth="Infinity"/>
<TextField fx:id="issuerTextField" maxWidth="Infinity" prefWidth="100" visible="false"/> <TextField fx:id="issuerTextField" maxWidth="Infinity" prefWidth="100" visible="false"/>
</StackPane> </StackPane>
<Label fx:id="issueRefLabel" text="Issuer Reference : " GridPane.halignment="RIGHT" GridPane.columnIndex="3" GridPane.rowIndex="3"/> <Label fx:id="issueRefLabel" text="Issuer Reference : " GridPane.halignment="RIGHT" GridPane.columnIndex="3"
GridPane.rowIndex="3"/>
<TextField fx:id="issueRefTextField" prefWidth="50" GridPane.columnIndex="4" GridPane.rowIndex="3"/> <TextField fx:id="issueRefTextField" prefWidth="50" GridPane.columnIndex="4" GridPane.rowIndex="3"/>
<!-- Row 4 --> <!-- Row 4 -->
<Label fx:id="currencyLabel" text="Currency : " GridPane.halignment="RIGHT" GridPane.rowIndex="4"/> <Label fx:id="currencyLabel" text="Currency : " GridPane.halignment="RIGHT" GridPane.rowIndex="4"/>
<ChoiceBox fx:id="currencyChoiceBox" GridPane.columnIndex="1" GridPane.rowIndex="4" maxWidth="Infinity"/> <ChoiceBox fx:id="currencyChoiceBox" GridPane.columnIndex="1" GridPane.rowIndex="4" maxWidth="Infinity"/>
<Label fx:id="availableAmount" text="100000 USD available" GridPane.rowIndex="4" GridPane.columnIndex="3" GridPane.columnSpan="2" styleClass="availableAmountLabel"/> <Label fx:id="availableAmount" text="100000 USD available" GridPane.rowIndex="4" GridPane.columnIndex="3"
GridPane.columnSpan="2" styleClass="availableAmountLabel"/>
<!-- Row 5 --> <!-- Row 5 -->
<Label fx:id="amountLabel" text="Amount : " GridPane.halignment="RIGHT" GridPane.rowIndex="5"/> <Label fx:id="amountLabel" text="Amount : " GridPane.halignment="RIGHT" GridPane.rowIndex="5"/>
<TextField fx:id="amountTextField" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="5" GridPane.columnSpan="4"/> <TextField fx:id="amountTextField" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS"
GridPane.rowIndex="5" GridPane.columnSpan="4"/>
<padding> <padding>
<Insets bottom="20.0" left="30.0" right="30.0" top="30.0"/> <Insets bottom="20.0" left="30.0" right="30.0" top="30.0"/>

View File

@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?> <?import de.jensd.fx.glyphs.fontawesome.*?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.ComboBox?> <?import javafx.scene.control.*?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<StackPane styleClass="searchField" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1"> <StackPane styleClass="searchField" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea"
xmlns:fx="http://javafx.com/fxml/1">
<padding> <padding>
<Insets bottom="5"/> <Insets bottom="5"/>
</padding> </padding>
<TextField fx:id="textField" promptText="Filter transactions by originator, contract type..."/> <TextField fx:id="textField" promptText="Filter transactions by originator, contract type..."/>
<FontAwesomeIconView fx:id="clearButton" glyphName="TIMES_CIRCLE" styleClass="search-clear" StackPane.alignment="CENTER_RIGHT"> <FontAwesomeIconView fx:id="clearButton" glyphName="TIMES_CIRCLE" styleClass="search-clear"
StackPane.alignment="CENTER_RIGHT">
<StackPane.margin> <StackPane.margin>
<Insets right="10.0"/> <Insets right="10.0"/>
</StackPane.margin> </StackPane.margin>

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?> <?import de.jensd.fx.glyphs.fontawesome.*?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<ScrollPane fitToWidth="true" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1"> <ScrollPane fitToWidth="true" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.112-ea"
xmlns:fx="http://javafx.com/fxml/1">
<VBox alignment="CENTER"> <VBox alignment="CENTER">
<padding> <padding>
<Insets bottom="10" left="10" right="10" top="10"/> <Insets bottom="10" left="10" right="10" top="10"/>
@ -19,10 +20,12 @@
<ComboBox fx:id="reportingCurrenciesComboBox" GridPane.columnIndex="1"/> <ComboBox fx:id="reportingCurrenciesComboBox" GridPane.columnIndex="1"/>
<Label text="Fullscreen :" GridPane.rowIndex="1"/> <Label text="Fullscreen :" GridPane.rowIndex="1"/>
<CheckBox fx:id="fullscreenCheckBox" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1"/> <CheckBox fx:id="fullscreenCheckBox" GridPane.columnIndex="1" GridPane.halignment="CENTER"
GridPane.rowIndex="1"/>
<Label text="Remember me :" GridPane.rowIndex="2"/> <Label text="Remember me :" GridPane.rowIndex="2"/>
<CheckBox fx:id="rememberMeCheckBox" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2"/> <CheckBox fx:id="rememberMeCheckBox" GridPane.columnIndex="1" GridPane.halignment="CENTER"
GridPane.rowIndex="2"/>
<Label text="Corda Node :" GridPane.rowIndex="3" GridPane.valignment="TOP"/> <Label text="Corda Node :" GridPane.rowIndex="3" GridPane.valignment="TOP"/>

View File

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.*?>
<?import javafx.scene.control.TableView?> <?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?> <BorderPane stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea"
<?import javafx.scene.layout.VBox?> xmlns:fx="http://javafx.com/fxml/1">
<BorderPane stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1">
<padding> <padding>
<Insets top="5" left="5" right="5" bottom="5"/> <Insets top="5" left="5" right="5" bottom="5"/>
</padding> </padding>

View File

@ -10,7 +10,8 @@
<Label fx:id="equivLabel" text="USD" wrapText="true" GridPane.rowIndex="4"/> <Label fx:id="equivLabel" text="USD" wrapText="true" GridPane.rowIndex="4"/>
<Label fx:id="stateIdValueLabel" text="39043-329090-390091" GridPane.columnIndex="1"/> <Label fx:id="stateIdValueLabel" text="39043-329090-390091" GridPane.columnIndex="1"/>
<Label fx:id="issuerValueLabel" styleClass="counterparty" text="C-03820 HSBC GROUP PLC" GridPane.columnIndex="1" GridPane.rowIndex="1"/> <Label fx:id="issuerValueLabel" styleClass="counterparty" text="C-03820 HSBC GROUP PLC" GridPane.columnIndex="1"
GridPane.rowIndex="1"/>
<Label fx:id="originatedValueLabel" text="2018-04-27 11:34 UTC" GridPane.columnIndex="1" GridPane.rowIndex="2"/> <Label fx:id="originatedValueLabel" text="2018-04-27 11:34 UTC" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
<Label fx:id="amountValueLabel" text="GBP 0.00" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="3"/> <Label fx:id="amountValueLabel" text="GBP 0.00" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="3"/>
<Label fx:id="equivValueLabel" text="0.00" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="4"/> <Label fx:id="equivValueLabel" text="0.00" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="4"/>

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<BorderPane stylesheets="@../../../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1"> <BorderPane stylesheets="@../../../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea"
xmlns:fx="http://javafx.com/fxml/1">
<padding> <padding>
<Insets right="5" left="5" bottom="5" top="5"/> <Insets right="5" left="5" bottom="5" top="5"/>
</padding> </padding>
@ -15,8 +16,10 @@
<VBox fx:id="leftPane" spacing="5.0"> <VBox fx:id="leftPane" spacing="5.0">
<TreeTableView fx:id="cashViewerTable" showRoot="false" VBox.vgrow="ALWAYS"> <TreeTableView fx:id="cashViewerTable" showRoot="false" VBox.vgrow="ALWAYS">
<columns> <columns>
<TreeTableColumn fx:id="cashViewerTableIssuerCurrency" styleClass="first-column" text="Issuer/Currency"/> <TreeTableColumn fx:id="cashViewerTableIssuerCurrency" styleClass="first-column"
<TreeTableColumn fx:id="cashViewerTableLocalCurrency" text="Local currency" styleClass="monetary-value, second-column"/> text="Issuer/Currency"/>
<TreeTableColumn fx:id="cashViewerTableLocalCurrency" text="Local currency"
styleClass="monetary-value, second-column"/>
<TreeTableColumn fx:id="cashViewerTableEquiv" styleClass="monetary-value" text="Equiv"/> <TreeTableColumn fx:id="cashViewerTableEquiv" styleClass="monetary-value" text="Equiv"/>
</columns> </columns>
</TreeTableView> </TreeTableView>

View File

@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<DialogPane stylesheets="@../../../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1"> <DialogPane stylesheets="@../../../css/corda.css" xmlns="http://javafx.com/javafx/8.0.76-ea"
xmlns:fx="http://javafx.com/fxml/1">
<content> <content>
<GridPane hgap="10" vgap="10"> <GridPane hgap="10" vgap="10">
<!-- Row 0 --> <!-- Row 0 -->
<Label text="Transaction Type : " GridPane.halignment="RIGHT"/> <Label text="Transaction Type : " GridPane.halignment="RIGHT"/>
<ChoiceBox fx:id="transactionTypeCB" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.columnSpan="4" GridPane.hgrow="ALWAYS"/> <ChoiceBox fx:id="transactionTypeCB" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.columnSpan="4"
GridPane.hgrow="ALWAYS"/>
<!-- Row 1 --> <!-- Row 1 -->
<Label fx:id="partyALabel" GridPane.halignment="RIGHT" GridPane.rowIndex="1"/> <Label fx:id="partyALabel" GridPane.halignment="RIGHT" GridPane.rowIndex="1"/>
@ -16,7 +18,8 @@
<!-- Row 2 --> <!-- Row 2 -->
<Label fx:id="partyBLabel" GridPane.halignment="RIGHT" GridPane.rowIndex="2"/> <Label fx:id="partyBLabel" GridPane.halignment="RIGHT" GridPane.rowIndex="2"/>
<ChoiceBox fx:id="partyBChoiceBox" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.columnSpan="4" GridPane.fillWidth="true" GridPane.hgrow="ALWAYS" GridPane.rowIndex="2"/> <ChoiceBox fx:id="partyBChoiceBox" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.columnSpan="4"
GridPane.fillWidth="true" GridPane.hgrow="ALWAYS" GridPane.rowIndex="2"/>
<!-- Row 3 --> <!-- Row 3 -->
<Label fx:id="issuerLabel" text="Issuer : " GridPane.halignment="RIGHT" GridPane.rowIndex="3"/> <Label fx:id="issuerLabel" text="Issuer : " GridPane.halignment="RIGHT" GridPane.rowIndex="3"/>
@ -24,18 +27,21 @@
<ChoiceBox fx:id="issuerChoiceBox" maxWidth="Infinity"/> <ChoiceBox fx:id="issuerChoiceBox" maxWidth="Infinity"/>
<TextField fx:id="issuerTextField" maxWidth="Infinity" prefWidth="100" visible="false"/> <TextField fx:id="issuerTextField" maxWidth="Infinity" prefWidth="100" visible="false"/>
</StackPane> </StackPane>
<Label fx:id="issueRefLabel" text="Issue Reference : " GridPane.halignment="RIGHT" GridPane.columnIndex="3" GridPane.rowIndex="3"/> <Label fx:id="issueRefLabel" text="Issue Reference : " GridPane.halignment="RIGHT" GridPane.columnIndex="3"
GridPane.rowIndex="3"/>
<TextField fx:id="issueRefTextField" prefWidth="50" GridPane.columnIndex="4" GridPane.rowIndex="3"/> <TextField fx:id="issueRefTextField" prefWidth="50" GridPane.columnIndex="4" GridPane.rowIndex="3"/>
<!-- Row 4 --> <!-- Row 4 -->
<Label fx:id="currencyLabel" text="Currency : " GridPane.halignment="RIGHT" GridPane.rowIndex="4"/> <Label fx:id="currencyLabel" text="Currency : " GridPane.halignment="RIGHT" GridPane.rowIndex="4"/>
<ChoiceBox fx:id="currencyChoiceBox" GridPane.columnIndex="1" GridPane.rowIndex="4" maxWidth="Infinity"/> <ChoiceBox fx:id="currencyChoiceBox" GridPane.columnIndex="1" GridPane.rowIndex="4" maxWidth="Infinity"/>
<Label fx:id="availableAmount" text="100000 USD available" GridPane.rowIndex="4" GridPane.columnIndex="3" GridPane.columnSpan="2" styleClass="availableAmountLabel"/> <Label fx:id="availableAmount" text="100000 USD available" GridPane.rowIndex="4" GridPane.columnIndex="3"
GridPane.columnSpan="2" styleClass="availableAmountLabel"/>
<!-- Row 5 --> <!-- Row 5 -->
<Label fx:id="amountLabel" text="Amount : " GridPane.halignment="RIGHT" GridPane.rowIndex="5"/> <Label fx:id="amountLabel" text="Amount : " GridPane.halignment="RIGHT" GridPane.rowIndex="5"/>
<TextField fx:id="amountTextField" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="5" GridPane.columnSpan="4"/> <TextField fx:id="amountTextField" maxWidth="Infinity" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS"
GridPane.rowIndex="5" GridPane.columnSpan="4"/>
<padding> <padding>
<Insets bottom="20.0" left="30.0" right="30.0" top="30.0"/> <Insets bottom="20.0" left="30.0" right="30.0" top="30.0"/>

View File

@ -1,34 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import java.lang.String?> <?import java.lang.*?>
<DialogPane expanded="true" headerText="Sign in to Corda" prefHeight="246.0" prefWidth="648.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1"> <DialogPane expanded="true" headerText="Sign in to Corda" prefHeight="246.0" prefWidth="648.0"
xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">
<content> <content>
<TilePane alignment="CENTER"> <TilePane alignment="CENTER">
<children> <children>
<TitledPane alignment="CENTER" collapsible="false" prefHeight="160.0" prefWidth="160.0" text="Log in"> <TitledPane alignment="CENTER" collapsible="false" prefHeight="160.0" prefWidth="160.0" text="Log in">
<content> <content>
<Label alignment="BOTTOM_RIGHT" prefHeight="200.0" prefWidth="200.0" text="Thomas" textAlignment="CENTER" wrapText="true" /> <Label alignment="BOTTOM_RIGHT" prefHeight="200.0" prefWidth="200.0" text="Thomas"
textAlignment="CENTER" wrapText="true"/>
</content> </content>
<styleClass> <styleClass>
<String fx:value="tile-user"/> <String fx:value="tile-user"/>
<String fx:value="tile-user-test-man"/> <String fx:value="tile-user-test-man"/>
</styleClass> </styleClass>
</TitledPane> </TitledPane>
<TitledPane alignment="CENTER" collapsible="false" layoutX="232.0" layoutY="10.0" prefHeight="160.0" prefWidth="160.0" text="Log in"> <TitledPane alignment="CENTER" collapsible="false" layoutX="232.0" layoutY="10.0" prefHeight="160.0"
prefWidth="160.0" text="Log in">
<styleClass> <styleClass>
<String fx:value="tile-user"/> <String fx:value="tile-user"/>
<String fx:value="tile-user-test-woman"/> <String fx:value="tile-user-test-woman"/>
</styleClass> </styleClass>
<content> <content>
<Label alignment="BOTTOM_RIGHT" prefHeight="200.0" prefWidth="200.0" text="Theresa" textAlignment="CENTER" wrapText="true" /> <Label alignment="BOTTOM_RIGHT" prefHeight="200.0" prefWidth="200.0" text="Theresa"
textAlignment="CENTER" wrapText="true"/>
</content> </content>
</TitledPane> </TitledPane>
<TitledPane alignment="CENTER" collapsible="false" layoutX="312.0" layoutY="10.0" prefHeight="160.0" prefWidth="160.0" styleClass="tile-user" text="Log in"> <TitledPane alignment="CENTER" collapsible="false" layoutX="312.0" layoutY="10.0" prefHeight="160.0"
prefWidth="160.0" styleClass="tile-user" text="Log in">
<content> <content>
<Label alignment="BOTTOM_RIGHT" prefHeight="200.0" prefWidth="200.0" text="Other user" textAlignment="CENTER" wrapText="true" /> <Label alignment="BOTTOM_RIGHT" prefHeight="200.0" prefWidth="200.0" text="Other user"
textAlignment="CENTER" wrapText="true"/>
</content> </content>
</TitledPane> </TitledPane>
</children> </children>

View File

@ -2,10 +2,9 @@
<?import javafx.geometry.*?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.Image?> <?import javafx.scene.image.*?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import java.lang.String?> <?import java.lang.*?>
<VBox xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1"> <VBox xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">
<children> <children>
<StackPane alignment="CENTER_RIGHT"> <StackPane alignment="CENTER_RIGHT">
@ -24,7 +23,8 @@
<Insets bottom="5.0" left="30.0" right="5.0" top="5.0"/> <Insets bottom="5.0" left="30.0" right="5.0" top="5.0"/>
</padding> </padding>
</TextField> </TextField>
<ImageView id="clear" fitHeight="16.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true" styleClass="search-clear"> <ImageView id="clear" fitHeight="16.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true"
styleClass="search-clear">
<image> <image>
<Image url="@Desktop/clear_inactive.png"/> <Image url="@Desktop/clear_inactive.png"/>
</image> </image>
@ -42,8 +42,10 @@
<styleClass> <styleClass>
<String fx:value="montetary-value"/> <String fx:value="montetary-value"/>
<String fx:value="second-column"/> <String fx:value="second-column"/>
</styleClass></TreeTableColumn> </styleClass>
<TreeTableColumn editable="false" minWidth="0.0" prefWidth="156.0" styleClass="montetary-value" text="Overdue" /> </TreeTableColumn>
<TreeTableColumn editable="false" minWidth="0.0" prefWidth="156.0" styleClass="montetary-value"
text="Overdue"/>
<TreeTableColumn prefWidth="75.0" styleClass="montetary-value" text="1d"/> <TreeTableColumn prefWidth="75.0" styleClass="montetary-value" text="1d"/>
<TreeTableColumn prefWidth="75.0" styleClass="montetary-value" text="2-7d"/> <TreeTableColumn prefWidth="75.0" styleClass="montetary-value" text="2-7d"/>
<TreeTableColumn prefWidth="75.0" styleClass="montetary-value" text="8-14d"/> <TreeTableColumn prefWidth="75.0" styleClass="montetary-value" text="8-14d"/>

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.TextField?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.Image?> <?import javafx.scene.image.*?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.layout.*?>
<?import javafx.scene.layout.StackPane?>
<StackPane alignment="CENTER_RIGHT" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1"> <StackPane alignment="CENTER_RIGHT" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1">
<children> <children>
<TextField fx:id="SearchCriteriaTextField" promptText="Set prompt text" styleClass="search"> <TextField fx:id="SearchCriteriaTextField" promptText="Set prompt text" styleClass="search">
@ -15,7 +14,8 @@
<Insets/> <Insets/>
</StackPane.margin> </StackPane.margin>
</TextField> </TextField>
<ImageView fitHeight="16.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true" styleClass="search-clear" StackPane.alignment="CENTER_RIGHT"> <ImageView fitHeight="16.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true" styleClass="search-clear"
StackPane.alignment="CENTER_RIGHT">
<image> <image>
<Image url="@../../images/clear_inactive.png"/> <Image url="@../../images/clear_inactive.png"/>
</image> </image>

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.*?>
<?import java.lang.String?> <?import java.lang.*?>
<DialogPane headerText="Issuer C039201 HSBC GROUP PLC" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1"> <DialogPane headerText="Issuer C039201 HSBC GROUP PLC" xmlns="http://javafx.com/javafx/8.0.60"
xmlns:fx="http://javafx.com/fxml/1">
<content> <content>
<VBox spacing="5.0"> <VBox spacing="5.0">
<children> <children>

View File

@ -42,10 +42,13 @@ fun setupJSchWithSshAgent(): JSch {
return IdentityRepository.UNAVAILABLE return IdentityRepository.UNAVAILABLE
} }
} }
override fun getName() = connector.name override fun getName() = connector.name
override fun getIdentities(): Vector<Identity> = Vector(listOf( override fun getIdentities(): Vector<Identity> = Vector(listOf(
object : Identity { object : Identity {
override fun clear() {} override fun clear() {
}
override fun getAlgName() = String(Buffer(identity.blob).string) override fun getAlgName() = String(Buffer(identity.blob).string)
override fun getName() = String(identity.comment) override fun getName() = String(identity.comment)
override fun isEncrypted() = false override fun isEncrypted() = false
@ -55,6 +58,7 @@ fun setupJSchWithSshAgent(): JSch {
override fun setPassphrase(passphrase: ByteArray?) = true override fun setPassphrase(passphrase: ByteArray?) = true
} }
)) ))
override fun remove(blob: ByteArray?) = throw UnsupportedOperationException() override fun remove(blob: ByteArray?) = throw UnsupportedOperationException()
override fun removeAll() = throw UnsupportedOperationException() override fun removeAll() = throw UnsupportedOperationException()
override fun add(identity: ByteArray?) = throw UnsupportedOperationException() override fun add(identity: ByteArray?) = throw UnsupportedOperationException()

View File

@ -2,7 +2,6 @@ package net.corda.loadtest
import kotlinx.support.jdk8.collections.parallelStream import kotlinx.support.jdk8.collections.parallelStream
import net.corda.client.mock.Generator import net.corda.client.mock.Generator
import net.corda.core.crypto.toBase58String
import net.corda.core.div import net.corda.core.div
import net.corda.node.driver.PortAllocation import net.corda.node.driver.PortAllocation
import net.corda.node.services.network.NetworkMapService import net.corda.node.services.network.NetworkMapService