From b9ecc5243f589b2b2f5790b8e2f374b47dfe2dfd Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Tue, 5 Feb 2019 15:06:06 +0000 Subject: [PATCH] Tell ProGuard to remove FlowLogic and ProgressTracker classes. --- core/src/main/kotlin/net/corda/core/flows/FlowLogic.kt | 3 +++ .../kotlin/net/corda/core/transactions/LedgerTransaction.kt | 5 +++++ .../main/kotlin/net/corda/core/utilities/ProgressTracker.kt | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/core/src/main/kotlin/net/corda/core/flows/FlowLogic.kt b/core/src/main/kotlin/net/corda/core/flows/FlowLogic.kt index b7a47ee34d..13a18e482d 100644 --- a/core/src/main/kotlin/net/corda/core/flows/FlowLogic.kt +++ b/core/src/main/kotlin/net/corda/core/flows/FlowLogic.kt @@ -3,6 +3,7 @@ package net.corda.core.flows import co.paralleluniverse.fibers.Suspendable import co.paralleluniverse.strands.Strand import net.corda.core.CordaInternal +import net.corda.core.DeleteForDJVM import net.corda.core.contracts.StateRef import net.corda.core.crypto.SecureHash import net.corda.core.identity.Party @@ -56,10 +57,12 @@ import java.util.* * relevant database transactions*. Only set this option to true if you know what you're doing. */ @Suppress("DEPRECATION", "DeprecatedCallableAddReplaceWith") +@DeleteForDJVM abstract class FlowLogic { /** This is where you should log things to. */ val logger: Logger get() = stateMachine.logger + @DeleteForDJVM companion object { /** * Return the outermost [FlowLogic] instance, or null if not in a flow. diff --git a/core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt b/core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt index 02317b8354..7ffa00df87 100644 --- a/core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt +++ b/core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt @@ -130,6 +130,11 @@ private constructor( Verifier(createLtxForVerification(), transactionClassLoader, inputStatesContractClassNameToMaxVersion) } + @StubOutForDJVM + private fun getParamsFromFlowLogic(): NetworkParameters? { + return FlowLogic.currentTopLevel?.serviceHub?.networkParameters + } + private fun createLtxForVerification(): LedgerTransaction { val serializedInputs = this.serializedInputs val serializedReferences = this.serializedReferences diff --git a/core/src/main/kotlin/net/corda/core/utilities/ProgressTracker.kt b/core/src/main/kotlin/net/corda/core/utilities/ProgressTracker.kt index a42fab4e1e..554526d71c 100644 --- a/core/src/main/kotlin/net/corda/core/utilities/ProgressTracker.kt +++ b/core/src/main/kotlin/net/corda/core/utilities/ProgressTracker.kt @@ -1,5 +1,6 @@ package net.corda.core.utilities +import net.corda.core.DeleteForDJVM import net.corda.core.internal.STRUCTURAL_STEP_PREFIX import net.corda.core.serialization.CordaSerializable import rx.Observable @@ -31,9 +32,11 @@ import java.util.* * using the [Observable] subscribeOn call. */ @CordaSerializable +@DeleteForDJVM class ProgressTracker(vararg inputSteps: Step) { @CordaSerializable + @DeleteForDJVM sealed class Change(val progressTracker: ProgressTracker) { data class Position(val tracker: ProgressTracker, val newStep: Step) : Change(tracker) { override fun toString() = newStep.label @@ -62,14 +65,17 @@ class ProgressTracker(vararg inputSteps: Step) { } // Sentinel objects. Overrides equals() to survive process restarts and serialization. + @DeleteForDJVM object UNSTARTED : Step("Unstarted") { override fun equals(other: Any?) = other === UNSTARTED } + @DeleteForDJVM object STARTING : Step("Starting") { override fun equals(other: Any?) = other === STARTING } + @DeleteForDJVM object DONE : Step("Done") { override fun equals(other: Any?) = other === DONE }