Merge branch 'master' of bitbucket.org:R3-CEV/r3prototyping

This commit is contained in:
Richard Green 2016-03-18 13:45:38 +00:00
commit 80af936a82
3 changed files with 5 additions and 2 deletions

View File

@ -154,7 +154,7 @@ class StateMachineManager(val serviceHub: ServiceHub, val runInThread: Executor)
}
private fun deserializeFiber(bits: ByteArray): ProtocolStateMachine<*> {
val deserializer = Fiber.getFiberSerializer() as KryoSerializer
val deserializer = Fiber.getFiberSerializer(false) as KryoSerializer
val kryo = createKryo(deserializer.kryo)
val psm = kryo.readClassAndObject(Input(bits)) as ProtocolStateMachine<*>
return psm

View File

@ -77,7 +77,7 @@ class ProtocolStateMachine<R>(val logic: ProtocolLogic<R>) : Fiber<R>("protocol"
private fun <T : Any> suspendAndExpectReceive(with: StateMachineManager.FiberRequest): UntrustworthyData<T> {
parkAndSerialize { fiber, serializer ->
// We don't use the passed-in serializer here, because we need to use our own augmented Kryo.
val deserializer = getFiberSerializer() as KryoSerializer
val deserializer = getFiberSerializer(false) as KryoSerializer
val kryo = createKryo(deserializer.kryo)
val stream = ByteArrayOutputStream()
Output(stream).use {

View File

@ -26,6 +26,7 @@ import java.security.KeyPair
import java.security.PublicKey
import java.security.SignatureException
import java.time.Instant
import kotlin.system.exitProcess
/**
* This asset trading protocol implements a "delivery vs payment" type swap. It has two parties (B and S for buyer
@ -211,6 +212,8 @@ object TwoPartyTradeProtocol {
val (ptx, cashSigningPubKeys) = assembleSharedTX(tradeRequest)
val stx = signWithOurKeys(cashSigningPubKeys, ptx)
// exitProcess(0)
val signatures = swapSignaturesWithSeller(stx, tradeRequest.sessionID)
logger.trace { "Got signatures from seller, verifying ... " }