Skip to content

Commit

Permalink
CORDA-3738: Upgrade to DJVM 1.1-RC02. (corda#6195)
Browse files Browse the repository at this point in the history
* CORDA-3738: Upgrade to DJVM 1.1-RC02.

* Update comment for DJVM 1.1's new requirements.
  • Loading branch information
chrisr3 authored Apr 30, 2020
1 parent 9bcb9b2 commit 83dd9a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion constants.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ snakeYamlVersion=1.19
caffeineVersion=2.7.0
metricsVersion=4.1.0
metricsNewRelicVersion=1.1.1
djvmVersion=1.1-RC01
djvmVersion=1.1-RC02
deterministicRtVersion=1.0-RC02
openSourceBranch=https://github.com/corda/corda/blob/release/os/4.4
openSourceSamplesBranch=https://github.com/corda/samples/blob/release-V4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,16 +401,15 @@ class ContractVerifier(private val transactionClassLoader: ClassLoader) : Functi

override fun apply(ltx: LedgerTransaction) {
val contractClassNames = (ltx.inputs.map(StateAndRef<ContractState>::state) + ltx.outputs)
.map(TransactionState<*>::contract)
.toSet()
.mapTo(LinkedHashSet(), TransactionState<*>::contract)

contractClassNames.associateBy(
{ it }, { createContractClass(ltx.id, it) }
).map { (contractClassName, contractClass) ->
try {
/**
* This function must execute with the DJVM's sandbox, which does not
* permit user code to access [java.lang.reflect.Constructor] objects.
* permit user code to invoke [java.lang.Class.getDeclaredConstructor].
*
* [Class.newInstance] is deprecated as of Java 9.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class NonDeterministicContractVerifyTest {
.returnValue.getOrThrow()
}
assertThat(ex)
.hasMessageMatching("^NoSuchMethodError: .*\\Qsandbox.java.lang.System.currentTimeMillis()\\E.*\$")
.hasMessageStartingWith("RuleViolationError: Disallowed reference to API; java.lang.System.currentTimeMillis(), ")
}
}

Expand All @@ -88,7 +88,7 @@ class NonDeterministicContractVerifyTest {
.returnValue.getOrThrow()
}
assertThat(ex)
.hasMessageMatching("^NoSuchMethodError: .*\\Qsandbox.java.lang.System.nanoTime()\\E.*\$")
.hasMessageStartingWith("RuleViolationError: Disallowed reference to API; java.lang.System.nanoTime(), ")
}
}

Expand Down

0 comments on commit 83dd9a9

Please sign in to comment.