mirror of
https://github.com/corda/corda.git
synced 2025-06-18 23:28:21 +00:00
ENT-1906: Publish DJVM artifact with its dependency information. (#3897)
Also migrate enclavelet code into testing:common jar.
This commit is contained in:
@ -1,11 +1,8 @@
|
||||
@file:JvmName("Enclavelet")
|
||||
package net.corda.deterministic.txverify
|
||||
|
||||
import net.corda.core.serialization.deserialize
|
||||
import net.corda.core.transactions.LedgerTransaction
|
||||
import net.corda.deterministic.bytesOfResource
|
||||
import net.corda.deterministic.common.LocalSerializationRule
|
||||
import net.corda.deterministic.common.TransactionVerificationRequest
|
||||
import net.corda.deterministic.common.verifyInEnclave
|
||||
import net.corda.finance.contracts.asset.Cash.Commands.*
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.ClassRule
|
||||
@ -30,23 +27,3 @@ class EnclaveletTest {
|
||||
assertThat(e).hasMessageContaining("Required ${Move::class.java.canonicalName} command")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns either null to indicate success when the transactions are validated, or a string with the
|
||||
* contents of the error. Invoked via JNI in response to an enclave RPC. The argument is a serialised
|
||||
* [TransactionVerificationRequest].
|
||||
*
|
||||
* Note that it is assumed the signatures were already checked outside the sandbox: the purpose of this code
|
||||
* is simply to check the sensitive, app specific parts of a transaction.
|
||||
*
|
||||
* TODO: Transaction data is meant to be encrypted under an enclave-private key.
|
||||
*/
|
||||
@Throws(Exception::class)
|
||||
private fun verifyInEnclave(reqBytes: ByteArray) {
|
||||
deserialize(reqBytes).verify()
|
||||
}
|
||||
|
||||
private fun deserialize(reqBytes: ByteArray): LedgerTransaction {
|
||||
return reqBytes.deserialize<TransactionVerificationRequest>()
|
||||
.toLedgerTransaction()
|
||||
}
|
||||
|
Reference in New Issue
Block a user