Revert making Verifier implement AutoCloseable.

This commit is contained in:
Chris Rankin 2019-10-01 14:14:54 +01:00
parent e570f1f423
commit 50baecf679
3 changed files with 2 additions and 16 deletions

View File

@ -29,7 +29,7 @@ fun LedgerTransaction.prepareVerify(extraAttachments: List<Attachment>) = this.i
* Because we create a separate [LedgerTransaction] onto which we need to perform verification, it becomes important we don't verify the
* wrong object instance. This class helps avoid that.
*/
abstract class Verifier(val ltx: LedgerTransaction, protected val transactionClassLoader: ClassLoader) : AutoCloseable {
abstract class Verifier(val ltx: LedgerTransaction, protected val transactionClassLoader: ClassLoader) {
private val inputStates: List<TransactionState<*>> = ltx.inputs.map { it.state }
private val allStates: List<TransactionState<*>> = inputStates + ltx.references.map { it.state } + ltx.outputs
@ -348,12 +348,6 @@ abstract class Verifier(val ltx: LedgerTransaction, protected val transactionCla
* Placeholder function for the contract verification logic.
*/
abstract fun verifyContracts()
/**
* Placeholder function so that the [Verifier] can release any resources.
*/
@Throws(Exception::class)
abstract override fun close()
}
class BasicVerifier(ltx: LedgerTransaction, transactionClassLoader: ClassLoader) : Verifier(ltx, transactionClassLoader) {
@ -371,8 +365,6 @@ class BasicVerifier(ltx: LedgerTransaction, transactionClassLoader: ClassLoader)
throw e
}
}
override fun close() {}
}
/**

View File

@ -187,9 +187,7 @@ private constructor(
*/
@Throws(TransactionVerificationException::class)
fun verify() {
internalPrepareVerify(emptyList()).use { v ->
v.verify()
}
internalPrepareVerify(emptyList()).verify()
}
/**

View File

@ -88,10 +88,6 @@ class DeterministicVerifier(
throw DeterministicVerificationException(ltx.id, sandboxEx.message ?: "", sandboxEx)
}
}
@Throws(Exception::class)
override fun close() {
}
}
class DeterministicVerificationException(id: SecureHash, message: String, cause: Throwable)