mirror of
https://github.com/corda/corda.git
synced 2025-06-18 15:18:16 +00:00
Remove targetPlatformVersion check from FinalityFlow and update docs (#4955)
In Corda 4, FinalityFlow was updated to become an initiated flow, in order to ensure a node does not have to accept any signed transaction it receives without being able to check it first. The old behaviour of FinalityFlow was gated behind a targetPlatformVersion check, to prevent apps targeting V4 from using the old behaviour. This is problematic for a few reasons. For an app wishing to be backwards compatible with a version running on V3, this forces the app to set targetPlatformVersion = 3, even if the app is thoroughly tested against V4. This goes against the purpose of the targetPlatformVersion. Another consequence is that an app remains pinned to targetPlatformVersion = 3 until it is sure that there are no other apps running at a lower version in the network, which would prevent newer versions of the app from taking advantage of features gated behind targetPlatformVersion checks. (Note that the restriction only prevents a new version of the app from initiating FinalityFlow with the old version - the old version is able to initiate a FinalityFlow and the new version will handle it, assuming the app has been written correctly.) This fix removes the targetPlatformVersion check from FinalityFlow, and also provides a few documentation updates to clarify what level of testing would be expected to set a targetPlatformVersion.
This commit is contained in:
@ -57,19 +57,6 @@ class FinalityFlowTests : WithFinality {
|
||||
willThrow<IllegalArgumentException>())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `prevent use of the old API if the CorDapp target version is 4`() {
|
||||
val bob = createBob()
|
||||
val stx = aliceNode.issuesCashTo(bob)
|
||||
val resultFuture = CordappResolver.withCordapp(targetPlatformVersion = 4) {
|
||||
@Suppress("DEPRECATION")
|
||||
aliceNode.startFlowAndRunNetwork(FinalityFlow(stx)).resultFuture
|
||||
}
|
||||
assertThatIllegalArgumentException().isThrownBy {
|
||||
resultFuture.getOrThrow()
|
||||
}.withMessageContaining("A flow session for each external participant to the transaction must be provided.")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `allow use of the old API if the CorDapp target version is 3`() {
|
||||
val oldBob = createBob(cordapps = listOf(tokenOldCordapp()))
|
||||
|
Reference in New Issue
Block a user