UntrustworthyData.Validator implements Serializable so that checkpoints with unwrap lambdas are valid (#972)

This commit is contained in:
Shams Asari 2017-07-05 16:04:59 +01:00 committed by Ross Nicoll
parent 1b30f24e57
commit a3c5f16909

View File

@ -2,6 +2,7 @@ package net.corda.core.utilities
import co.paralleluniverse.fibers.Suspendable
import net.corda.core.flows.FlowException
import java.io.Serializable
/**
* A small utility to approximate taint tracking: if a method gives you back one of these, it means the data came from
@ -27,7 +28,7 @@ class UntrustworthyData<out T>(private val fromUntrustedWorld: T) {
@Deprecated("This old name was confusing, use unwrap instead", replaceWith = ReplaceWith("unwrap"))
inline fun <R> validate(validator: (T) -> R) = validator(data)
interface Validator<in T, out R> {
interface Validator<in T, out R> : Serializable {
@Suspendable
@Throws(FlowException::class)
fun validate(data: T): R