From c36fb625b72e87395b5a37049e2244ad518f2344 Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Mon, 30 Sep 2024 18:00:24 +0100 Subject: [PATCH 01/10] Move code from components into new library --- .../ledger/ledger-utxo-flow/build.gradle | 1 + .../tests/UtxoFilteredTransactionTest.kt | 4 +- ...dLedgerTransactionKryoSerializationTest.kt | 4 +- ...oSignedTransactionKryoSerializationTest.kt | 2 +- .../utxo/flow/impl/UtxoLedgerServiceImpl.kt | 16 ++-- .../TransactionBackchainVerifierImpl.kt | 2 +- .../v1/TransactionBackchainReceiverFlowV1.kt | 4 +- .../v1/TransactionBackchainSenderFlowV1.kt | 2 +- .../impl/flows/finality/FinalityPayload.kt | 2 +- .../impl/flows/finality/UtxoFinalityFlow.kt | 2 +- .../flows/finality/UtxoFinalityFlowUtils.kt | 2 +- .../flows/finality/v1/UtxoFinalityBaseV1.kt | 4 +- .../flows/finality/v1/UtxoFinalityFlowV1.kt | 4 +- .../finality/v1/UtxoReceiveFinalityFlowV1.kt | 8 +- .../impl/flows/repair/UtxoLedgerRepairFlow.kt | 2 +- .../ReceiveAndUpdateTransactionBuilderFlow.kt | 2 +- .../SendTransactionBuilderDiffFlow.kt | 6 +- ...eceiveAndUpdateTransactionBuilderFlowV1.kt | 2 +- .../v1/SendTransactionBuilderDiffFlowV1.kt | 4 +- .../v1/TransactionBuilderPayload.kt | 2 +- .../v1/ReceiveSignedTransactionFlowV1.kt | 4 +- .../v1/ReceiveWireTransactionFlowV1.kt | 2 +- .../v1/SendSignedTransactionFlowV1.kt | 2 +- .../v1/SendWireTransactionFlowV1.kt | 2 +- .../SignedGroupParametersVerifierImpl.kt | 1 + ...erGroupParametersPersistenceServiceImpl.kt | 1 + .../UtxoLedgerPersistenceService.kt | 2 +- .../UtxoLedgerPersistenceServiceImpl.kt | 10 +-- .../UtxoLedgerStateQueryServiceImpl.kt | 1 + .../UtxoLedgerTransactionFactoryOsgiImpl.kt | 45 ++++++++++ .../UtxoSignedTransactionFactoryOsgiImpl.kt | 83 +++++++++++++++++++ .../UtxoFilteredTransactionBuilderImpl.kt | 2 +- .../factory/UtxoFilteredTransactionFactory.kt | 2 +- .../UtxoFilteredTransactionFactoryImpl.kt | 2 +- .../amqp/UtxoSignedTransactionSerializer.kt | 8 +- .../amqp/UtxoTransactionBuilderSerializer.kt | 2 +- ...xoSignedLedgerTransactionKryoSerializer.kt | 6 +- .../UtxoSignedTransactionKryoSerializer.kt | 8 +- .../NotarySignatureVerificationServiceImpl.kt | 1 + ...sactionVerificationExternalEventFactory.kt | 2 +- .../UtxoBaselinedTransactionBuilder.kt | 12 ++- ...edgerTransactionVerificationServiceImpl.kt | 5 +- .../flow/impl/UtxoLedgerServiceImplTest.kt | 4 +- .../TransactionBackchainVerifierImplTest.kt | 4 +- .../TransactionBackchainReceiverFlowV1Test.kt | 6 +- .../flows/common/SendTransactionFlowTest.kt | 2 +- ...txoFinalityFlowVersionedFlowFactoryTest.kt | 2 +- .../finality/v1/UtxoFinalityFlowV1Test.kt | 4 +- .../v1/UtxoReceiveFinalityFlowV1Test.kt | 10 +-- .../flows/repair/UtxoLedgerRepairFlowTest.kt | 2 +- ...veAndUpdateTransactionBuilderFlowV1Test.kt | 8 +- .../SendTransactionBuilderDiffFlowV1Test.kt | 12 +-- .../ReceiveSignedTransactionFlowV1Test.kt | 4 +- .../ReceiveWireTransactionFlowV1Test.kt | 2 +- .../SendSignedTransactionFlowV1Test.kt | 2 +- .../SendWireTransactionFlowV1Test.kt | 2 +- .../UtxoLedgerPersistenceServiceImplTest.kt | 12 +-- ...UtxoBaselinedTransactionBuilderDiffTest.kt | 4 + .../UtxoBaselinedTransactionBuilderTest.kt | 1 + .../UtxoLedgerTransactionImplTest.kt | 1 + .../UtxoSignedTransactionImplTest.kt | 2 + .../UtxoTransactionBuilderImplAppendTest.kt | 5 +- .../UtxoTransactionBuilderImplTest.kt | 3 + .../UtxoFilteredTransactionFactoryImplTest.kt | 4 +- .../UtxoTransactionBuilderSerializerTest.kt | 2 +- ...UtxoSignedTransactionKryoSerializerTest.kt | 2 +- ...rTransactionVerificationServiceImplTest.kt | 3 +- .../UtxoTransactionBuilderVerifierTest.kt | 5 +- ...ionVerificationExternalEventFactoryTest.kt | 3 + ...natureAndMetadataJsonSerializationTests.kt | 4 +- libs/ledger-lib-utxo-flow/build.gradle | 37 +++++++++ .../impl/groupparameters/package-info.java | 4 + .../flow/impl/persistence/package-info.java | 4 + .../flow/impl/timewindow/package-info.java | 4 + .../factory/impl/package-info.java | 4 + .../transaction/factory/package-info.java | 4 + .../flow/impl/transaction/package-info.java | 4 + .../transaction/verifier/package-info.java | 4 + .../SignedGroupParametersVerifier.kt | 2 +- ...LedgerGroupParametersPersistenceService.kt | 2 +- .../UtxoLedgerStateQueryService.kt | 2 +- .../impl/timewindow/TimeWindowBetweenImpl.kt | 2 +- .../impl/timewindow/TimeWindowUntilImpl.kt | 2 +- .../ContractStateAndEncumbranceTag.kt | 2 +- .../UtxoSignedLedgerTransaction.kt | 2 +- .../transaction/UtxoSignedTransactionImpl.kt | 6 +- .../UtxoSignedTransactionInternal.kt | 2 +- .../UtxoTransactionBuilderContainer.kt | 2 +- .../transaction/UtxoTransactionBuilderData.kt | 2 +- .../transaction/UtxoTransactionBuilderImpl.kt | 31 ++++--- .../UtxoTransactionBuilderInternal.kt | 2 +- .../factory/UtxoLedgerTransactionFactory.kt | 2 +- .../factory/UtxoSignedTransactionFactory.kt | 6 +- .../impl/UtxoLedgerTransactionFactoryImpl.kt | 24 ++---- .../impl/UtxoSignedTransactionFactoryImpl.kt | 46 +++------- ...arySignatureVerificationServiceInternal.kt | 2 +- ...txoLedgerTransactionVerificationService.kt | 2 +- .../UtxoSignedLedgerTransactionImpl.kt | 4 +- .../UtxoSignedTransactionWithDependencies.kt | 3 +- .../UtxoTransactionBuilderVerifier.kt | 4 +- settings.gradle | 3 +- .../ledger/ledger-utxo-base-test/build.gradle | 1 + .../corda/ledger/utxo/test/UtxoLedgerTest.kt | 16 ++-- .../ledger/ledger-utxo-testkit/build.gradle | 1 + .../utxo/testkit/UtxoLedgerIntegrationTest.kt | 6 +- .../testkit/UtxoSignedTransactionExample.kt | 12 +-- .../utxo/testkit/UtxoTimeWindowExample.kt | 4 +- 107 files changed, 419 insertions(+), 234 deletions(-) create mode 100644 components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryOsgiImpl.kt create mode 100644 components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt rename components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/{external/events => }/TransactionVerificationExternalEventFactory.kt (97%) rename components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/{ => verifier}/UtxoBaselinedTransactionBuilder.kt (94%) create mode 100644 libs/ledger-lib-utxo-flow/build.gradle create mode 100644 libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/groupparameters/package-info.java create mode 100644 libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/persistence/package-info.java create mode 100644 libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/timewindow/package-info.java create mode 100644 libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/package-info.java create mode 100644 libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/package-info.java create mode 100644 libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/package-info.java create mode 100644 libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/package-info.java rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/groupparameters}/SignedGroupParametersVerifier.kt (90%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt (95%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/persistence/UtxoLedgerStateQueryService.kt (95%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/timewindow/TimeWindowBetweenImpl.kt (93%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/timewindow/TimeWindowUntilImpl.kt (95%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/ContractStateAndEncumbranceTag.kt (94%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/UtxoSignedLedgerTransaction.kt (93%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/UtxoSignedTransactionImpl.kt (97%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/UtxoSignedTransactionInternal.kt (98%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/UtxoTransactionBuilderContainer.kt (93%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/UtxoTransactionBuilderData.kt (93%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt (88%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/UtxoTransactionBuilderInternal.kt (93%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/factory/UtxoLedgerTransactionFactory.kt (95%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/factory/UtxoSignedTransactionFactory.kt (71%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt (81%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt (76%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceInternal.kt (88%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationService.kt (89%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier}/UtxoSignedLedgerTransactionImpl.kt (90%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier}/UtxoSignedTransactionWithDependencies.kt (87%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifier.kt (93%) diff --git a/components/ledger/ledger-utxo-flow/build.gradle b/components/ledger/ledger-utxo-flow/build.gradle index 56f0d1e542a..8af5dcac709 100644 --- a/components/ledger/ledger-utxo-flow/build.gradle +++ b/components/ledger/ledger-utxo-flow/build.gradle @@ -40,6 +40,7 @@ dependencies { implementation project(':libs:ledger:ledger-common-data') implementation project(':libs:ledger:ledger-utxo-data') implementation project(':libs:ledger:ledger-utxo-transaction-verifier') + implementation project(':libs:ledger-lib-utxo-flow') implementation project(':libs:metrics') implementation project(':libs:platform-info') implementation project(':libs:sandbox') diff --git a/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/tests/UtxoFilteredTransactionTest.kt b/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/tests/UtxoFilteredTransactionTest.kt index 0ea72e179ce..c28ac8f825c 100644 --- a/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/tests/UtxoFilteredTransactionTest.kt +++ b/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/tests/UtxoFilteredTransactionTest.kt @@ -2,9 +2,9 @@ package net.corda.ledger.utxo.flow.impl.transaction.filtered.tests import net.corda.crypto.core.parseSecureHash import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowBetweenImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.data.transaction.UtxoOutputInfoComponent -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowBetweenImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.testkit.UtxoLedgerIntegrationTest import net.corda.ledger.utxo.testkit.UtxoStateClassExample import net.corda.ledger.utxo.testkit.createExample diff --git a/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedLedgerTransactionKryoSerializationTest.kt b/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedLedgerTransactionKryoSerializationTest.kt index e15fa60c209..cf81c7f6d5b 100644 --- a/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedLedgerTransactionKryoSerializationTest.kt +++ b/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedLedgerTransactionKryoSerializationTest.kt @@ -1,7 +1,7 @@ package net.corda.ledger.utxo.flow.impl.transaction.serializer.tests -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransactionImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoSignedLedgerTransactionImpl import net.corda.ledger.utxo.testkit.UtxoLedgerIntegrationTest import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Assertions.assertDoesNotThrow diff --git a/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedTransactionKryoSerializationTest.kt b/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedTransactionKryoSerializationTest.kt index 98fd95a85b6..975b4cb1d4c 100644 --- a/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedTransactionKryoSerializationTest.kt +++ b/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedTransactionKryoSerializationTest.kt @@ -1,6 +1,6 @@ package net.corda.ledger.utxo.flow.impl.transaction.serializer.tests -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.testkit.UtxoLedgerIntegrationTest import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Assertions diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/UtxoLedgerServiceImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/UtxoLedgerServiceImpl.kt index d0da8c147f8..f3fa7365f08 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/UtxoLedgerServiceImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/UtxoLedgerServiceImpl.kt @@ -4,6 +4,13 @@ import net.corda.flow.application.services.FlowCheckpointService import net.corda.flow.external.events.executor.ExternalEventExecutor import net.corda.flow.persistence.query.ResultSetFactory import net.corda.ledger.common.data.transaction.TransactionStatus +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoSignedTransactionWithDependencies import net.corda.ledger.utxo.flow.impl.flows.finality.UtxoFinalityFlow import net.corda.ledger.utxo.flow.impl.flows.finality.UtxoReceiveFinalityFlow import net.corda.ledger.utxo.flow.impl.flows.transactionbuilder.ReceiveAndUpdateTransactionBuilderFlow @@ -14,17 +21,10 @@ import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.SendSignedT import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.SendWireTransactionFlow import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerStateQueryService import net.corda.ledger.utxo.flow.impl.persistence.VaultNamedParameterizedQueryImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoBaselinedTransactionBuilder -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionWithDependencies -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory import net.corda.ledger.utxo.flow.impl.transaction.filtered.UtxoFilteredTransactionBuilderImpl import net.corda.ledger.utxo.flow.impl.transaction.filtered.factory.UtxoFilteredTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService +import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoBaselinedTransactionBuilder import net.corda.sandbox.type.UsedByFlow import net.corda.sandboxgroupcontext.CurrentSandboxGroupContext import net.corda.utilities.time.UTCClock diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/TransactionBackchainVerifierImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/TransactionBackchainVerifierImpl.kt index da7cd4005a0..80836cafe12 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/TransactionBackchainVerifierImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/TransactionBackchainVerifierImpl.kt @@ -3,9 +3,9 @@ package net.corda.ledger.utxo.flow.impl.flows.backchain import net.corda.ledger.common.data.transaction.TransactionStatus.INVALID import net.corda.ledger.common.data.transaction.TransactionStatus.UNVERIFIED import net.corda.ledger.common.data.transaction.TransactionStatus.VERIFIED +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.flow.impl.flows.finality.getVisibleStateIndexes import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.sandbox.type.SandboxConstants.CORDA_SYSTEM_SERVICE import net.corda.sandbox.type.UsedByFlow import net.corda.utilities.trace diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1.kt index eb44dbcc57f..06b15e67f1a 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1.kt @@ -8,13 +8,13 @@ import net.corda.ledger.common.data.transaction.TransactionStatus.DRAFT import net.corda.ledger.common.data.transaction.TransactionStatus.INVALID import net.corda.ledger.common.data.transaction.TransactionStatus.UNVERIFIED import net.corda.ledger.common.data.transaction.TransactionStatus.VERIFIED +import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.UtxoLedgerMetricRecorder import net.corda.ledger.utxo.flow.impl.flows.backchain.InvalidBackchainException import net.corda.ledger.utxo.flow.impl.flows.backchain.TopologicalSort import net.corda.ledger.utxo.flow.impl.flows.backchain.dependencies -import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier import net.corda.ledger.utxo.flow.impl.persistence.TransactionExistenceStatus -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService import net.corda.membership.lib.SignedGroupParameters import net.corda.sandbox.CordaSystemFlow diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainSenderFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainSenderFlowV1.kt index 0a1868e5605..76f008a56b0 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainSenderFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainSenderFlowV1.kt @@ -1,6 +1,6 @@ package net.corda.ledger.utxo.flow.impl.flows.backchain.v1 -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService import net.corda.sandbox.CordaSystemFlow import net.corda.utilities.trace diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/FinalityPayload.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/FinalityPayload.kt index 7ae9cf15b63..5f5a55eda73 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/FinalityPayload.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/FinalityPayload.kt @@ -1,6 +1,6 @@ package net.corda.ledger.utxo.flow.impl.flows.finality -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.v5.base.annotations.ConstructorForDeserialization import net.corda.v5.base.annotations.CordaSerializable import net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlow.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlow.kt index 5cf25197525..815ae80e044 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlow.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlow.kt @@ -2,9 +2,9 @@ package net.corda.ledger.utxo.flow.impl.flows.finality import net.corda.flow.application.services.VersioningService import net.corda.flow.application.versioning.VersionedSendFlowFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.flows.finality.v1.UtxoFinalityFlowV1 import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryDetails -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.libs.platform.PlatformVersion.CORDA_5_1 import net.corda.sandbox.CordaSystemFlow import net.corda.v5.application.flows.CordaInject diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlowUtils.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlowUtils.kt index 4d92d68f87c..e08cc7c5d9f 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlowUtils.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlowUtils.kt @@ -1,7 +1,7 @@ package net.corda.ledger.utxo.flow.impl.flows.finality import net.corda.flow.state.asFlowContext -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.utilities.MDC_LOGGED_PREFIX import net.corda.v5.application.flows.FlowEngine import net.corda.v5.base.annotations.Suspendable diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityBaseV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityBaseV1.kt index 6162e358ce9..1b781e8c88f 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityBaseV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityBaseV1.kt @@ -2,9 +2,9 @@ package net.corda.ledger.utxo.flow.impl.flows.finality.v1 import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.flow.flows.Payload +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.sandbox.CordaSystemFlow import net.corda.utilities.debug import net.corda.v5.application.crypto.DigitalSignatureAndMetadata diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityFlowV1.kt index 69d13d7eceb..cf0c6dff88d 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityFlowV1.kt @@ -4,6 +4,8 @@ import net.corda.crypto.core.fullId import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.flow.flows.Payload import net.corda.ledger.common.flow.transaction.TransactionMissingSignaturesException +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoSignedTransactionWithDependencies import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainSenderFlow import net.corda.ledger.utxo.flow.impl.flows.backchain.dependencies import net.corda.ledger.utxo.flow.impl.flows.finality.FinalityPayload @@ -12,8 +14,6 @@ import net.corda.ledger.utxo.flow.impl.flows.finality.getVisibleStateIndexes import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryDetails import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionWithDependencies import net.corda.sandbox.CordaSystemFlow import net.corda.utilities.debug import net.corda.utilities.trace diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1.kt index a86c80f9df9..949eb1b10f9 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1.kt @@ -4,6 +4,10 @@ import net.corda.flow.application.GroupParametersLookupInternal import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.flow.flows.Payload +import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.ledger.utxo.data.transaction.verifyFilteredTransactionAndSignatures import net.corda.ledger.utxo.flow.impl.flows.backchain.InvalidBackchainException import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainResolutionFlow @@ -12,10 +16,6 @@ import net.corda.ledger.utxo.flow.impl.flows.finality.FinalityPayload import net.corda.ledger.utxo.flow.impl.flows.finality.addTransactionIdToFlowContext import net.corda.ledger.utxo.flow.impl.flows.finality.getVisibleStateIndexes import net.corda.ledger.utxo.flow.impl.flows.finality.v1.FinalityNotarizationFailureType.Companion.toFinalityNotarizationFailureType -import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.membership.lib.SignedGroupParameters import net.corda.sandbox.CordaSystemFlow import net.corda.utilities.trace diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/repair/UtxoLedgerRepairFlow.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/repair/UtxoLedgerRepairFlow.kt index 59d0b61cdc3..9d192dadb23 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/repair/UtxoLedgerRepairFlow.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/repair/UtxoLedgerRepairFlow.kt @@ -2,6 +2,7 @@ package net.corda.ledger.utxo.flow.impl.flows.repair import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.flow.transaction.TransactionMissingSignaturesException +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.flows.finality.getVisibleStateIndexes import net.corda.ledger.utxo.flow.impl.flows.repair.UtxoLedgerRepairFlow.RepairedTransactionResult.Invalid import net.corda.ledger.utxo.flow.impl.flows.repair.UtxoLedgerRepairFlow.RepairedTransactionResult.NotNotarized @@ -9,7 +10,6 @@ import net.corda.ledger.utxo.flow.impl.flows.repair.UtxoLedgerRepairFlow.Repaire import net.corda.ledger.utxo.flow.impl.flows.repair.UtxoLedgerRepairFlow.RepairedTransactionResult.Skipped import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.utilities.debug import net.corda.utilities.time.Clock import net.corda.utilities.time.UTCClock diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/ReceiveAndUpdateTransactionBuilderFlow.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/ReceiveAndUpdateTransactionBuilderFlow.kt index f3592ef259a..73c0f15d8b9 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/ReceiveAndUpdateTransactionBuilderFlow.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/ReceiveAndUpdateTransactionBuilderFlow.kt @@ -2,8 +2,8 @@ package net.corda.ledger.utxo.flow.impl.flows.transactionbuilder import net.corda.flow.application.services.VersioningService import net.corda.flow.application.versioning.VersionedReceiveFlowFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.ledger.utxo.flow.impl.flows.transactionbuilder.v1.ReceiveAndUpdateTransactionBuilderFlowV1 -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.sandbox.CordaSystemFlow import net.corda.v5.application.flows.CordaInject import net.corda.v5.application.flows.SubFlow diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/SendTransactionBuilderDiffFlow.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/SendTransactionBuilderDiffFlow.kt index e42fb97a1d9..b546093a18e 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/SendTransactionBuilderDiffFlow.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/SendTransactionBuilderDiffFlow.kt @@ -2,10 +2,10 @@ package net.corda.ledger.utxo.flow.impl.flows.transactionbuilder import net.corda.flow.application.services.VersioningService import net.corda.flow.application.versioning.VersionedSendFlowFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.ledger.utxo.flow.impl.flows.transactionbuilder.v1.SendTransactionBuilderDiffFlowV1 -import net.corda.ledger.utxo.flow.impl.transaction.UtxoBaselinedTransactionBuilder -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoBaselinedTransactionBuilder import net.corda.sandbox.CordaSystemFlow import net.corda.v5.application.flows.CordaInject import net.corda.v5.application.flows.SubFlow diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/ReceiveAndUpdateTransactionBuilderFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/ReceiveAndUpdateTransactionBuilderFlowV1.kt index 46a5364e7c5..94bc979878a 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/ReceiveAndUpdateTransactionBuilderFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/ReceiveAndUpdateTransactionBuilderFlowV1.kt @@ -1,9 +1,9 @@ package net.corda.ledger.utxo.flow.impl.flows.transactionbuilder.v1 +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.ledger.utxo.data.transaction.verifyFilteredTransactionAndSignatures import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainResolutionFlow import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.sandbox.CordaSystemFlow import net.corda.utilities.trace import net.corda.v5.application.flows.CordaInject diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/SendTransactionBuilderDiffFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/SendTransactionBuilderDiffFlowV1.kt index deb1d44bb36..2441c01f34b 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/SendTransactionBuilderDiffFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/SendTransactionBuilderDiffFlowV1.kt @@ -1,9 +1,9 @@ package net.corda.ledger.utxo.flow.impl.flows.transactionbuilder.v1 +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainSenderFlow import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerStateQueryService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer import net.corda.sandbox.CordaSystemFlow import net.corda.utilities.trace import net.corda.v5.application.flows.CordaInject diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/TransactionBuilderPayload.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/TransactionBuilderPayload.kt index 34e98a5acf0..0c536aeff24 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/TransactionBuilderPayload.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/TransactionBuilderPayload.kt @@ -1,6 +1,6 @@ package net.corda.ledger.utxo.flow.impl.flows.transactionbuilder.v1 -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer import net.corda.v5.base.annotations.ConstructorForDeserialization import net.corda.v5.base.annotations.CordaSerializable import net.corda.v5.ledger.utxo.transaction.filtered.UtxoFilteredTransactionAndSignatures diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/ReceiveSignedTransactionFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/ReceiveSignedTransactionFlowV1.kt index b73c9abd0d3..d50e2d2da36 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/ReceiveSignedTransactionFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/ReceiveSignedTransactionFlowV1.kt @@ -2,12 +2,12 @@ package net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.v1 import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.flow.flows.Payload +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.flow.impl.flows.finality.getVisibleStateIndexes import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.TransactionDependencyResolutionFlow import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.UtxoTransactionPayload import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.sandbox.CordaSystemFlow import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.application.flows.CordaInject diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/ReceiveWireTransactionFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/ReceiveWireTransactionFlowV1.kt index 9c091528c11..ae3a4ba2fca 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/ReceiveWireTransactionFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/ReceiveWireTransactionFlowV1.kt @@ -2,10 +2,10 @@ package net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.v1 import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.flow.flows.Payload +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.ledger.utxo.data.transaction.WrappedUtxoWireTransaction import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.TransactionDependencyResolutionFlow import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.UtxoTransactionPayload -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.sandbox.CordaSystemFlow import net.corda.v5.application.flows.CordaInject import net.corda.v5.application.flows.FlowEngine diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/SendSignedTransactionFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/SendSignedTransactionFlowV1.kt index c5b6f08b935..f50b70567b4 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/SendSignedTransactionFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/SendSignedTransactionFlowV1.kt @@ -1,7 +1,7 @@ package net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.v1 +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.SendTransactionFlow -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.sandbox.CordaSystemFlow import net.corda.v5.application.flows.CordaInject import net.corda.v5.application.flows.FlowEngine diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/SendWireTransactionFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/SendWireTransactionFlowV1.kt index 262516c27fc..7299ce75b3f 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/SendWireTransactionFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/v1/SendWireTransactionFlowV1.kt @@ -1,7 +1,7 @@ package net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.v1 +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.SendTransactionFlow -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.sandbox.CordaSystemFlow import net.corda.v5.application.flows.CordaInject import net.corda.v5.application.flows.FlowEngine diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifierImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifierImpl.kt index 092f813935e..b876cc8881e 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifierImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifierImpl.kt @@ -3,6 +3,7 @@ package net.corda.ledger.utxo.flow.impl.groupparameters.verifier import net.corda.crypto.cipher.suite.SignatureVerificationService import net.corda.flow.application.GroupParametersLookupInternal import net.corda.ledger.common.data.transaction.TransactionMetadataInternal +import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier import net.corda.membership.lib.SignedGroupParameters import net.corda.sandbox.type.SandboxConstants.CORDA_SYSTEM_SERVICE import net.corda.sandbox.type.UsedByFlow diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceServiceImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceServiceImpl.kt index ff86f1d6271..402dd55e18a 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceServiceImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceServiceImpl.kt @@ -3,6 +3,7 @@ package net.corda.ledger.utxo.flow.impl.persistence import io.micrometer.core.instrument.Timer import net.corda.flow.external.events.executor.ExternalEventExecutor import net.corda.flow.fiber.metrics.recordSuspendable +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.LedgerPersistenceMetricOperationName.FindGroupParameters import net.corda.ledger.utxo.flow.impl.persistence.LedgerPersistenceMetricOperationName.PersistSignedGroupParametersIfDoNotExist import net.corda.ledger.utxo.flow.impl.persistence.external.events.FindSignedGroupParametersExternalEventFactory diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceService.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceService.kt index fdbc4ff658e..5bd31d1ef93 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceService.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceService.kt @@ -1,7 +1,7 @@ package net.corda.ledger.utxo.flow.impl.persistence import net.corda.ledger.common.data.transaction.TransactionStatus -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.application.persistence.CordaPersistenceException import net.corda.v5.base.annotations.Suspendable diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceServiceImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceServiceImpl.kt index 28e01fa2ee2..dd57177ba2a 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceServiceImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceServiceImpl.kt @@ -9,6 +9,11 @@ import net.corda.ledger.common.data.transaction.SignedTransactionContainer import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.data.transaction.TransactionStatus.Companion.toTransactionStatus import net.corda.ledger.common.data.transaction.filtered.FilteredTransaction +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoSignedLedgerTransactionImpl import net.corda.ledger.utxo.data.transaction.SignedLedgerTransactionContainer import net.corda.ledger.utxo.data.transaction.UtxoFilteredTransactionAndSignaturesImpl import net.corda.ledger.utxo.data.transaction.UtxoLedgerLastPersistedTimestamp @@ -42,11 +47,6 @@ import net.corda.ledger.utxo.flow.impl.persistence.external.events.PersistTransa import net.corda.ledger.utxo.flow.impl.persistence.external.events.PersistTransactionSignaturesParameters import net.corda.ledger.utxo.flow.impl.persistence.external.events.UpdateTransactionStatusExternalEventFactory import net.corda.ledger.utxo.flow.impl.persistence.external.events.UpdateTransactionStatusParameters -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransactionImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory import net.corda.ledger.utxo.flow.impl.transaction.filtered.UtxoFilteredTransactionImpl import net.corda.ledger.utxo.flow.impl.transaction.filtered.factory.UtxoFilteredTransactionFactory import net.corda.metrics.CordaMetrics diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerStateQueryServiceImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerStateQueryServiceImpl.kt index b373e4f1f55..04546852a58 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerStateQueryServiceImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerStateQueryServiceImpl.kt @@ -3,6 +3,7 @@ package net.corda.ledger.utxo.flow.impl.persistence import io.micrometer.core.instrument.Timer import net.corda.flow.external.events.executor.ExternalEventExecutor import net.corda.flow.fiber.metrics.recordSuspendable +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService import net.corda.ledger.utxo.flow.impl.cache.StateAndRefCache import net.corda.ledger.utxo.flow.impl.persistence.LedgerPersistenceMetricOperationName.FindUnconsumedStatesByType import net.corda.ledger.utxo.flow.impl.persistence.LedgerPersistenceMetricOperationName.ResolveStateRefs diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryOsgiImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryOsgiImpl.kt new file mode 100644 index 00000000000..2e91187230c --- /dev/null +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryOsgiImpl.kt @@ -0,0 +1,45 @@ +package net.corda.ledger.utxo.flow.impl.transaction.factory.impl + +import net.corda.flow.application.GroupParametersLookupInternal +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoLedgerTransactionFactoryImpl +import net.corda.sandbox.type.SandboxConstants.CORDA_SYSTEM_SERVICE +import net.corda.sandbox.type.UsedByFlow +import net.corda.v5.application.serialization.SerializationService +import net.corda.v5.serialization.SingletonSerializeAsToken +import org.osgi.service.component.annotations.Activate +import org.osgi.service.component.annotations.Component +import org.osgi.service.component.annotations.Reference +import org.osgi.service.component.annotations.ServiceScope.PROTOTYPE + +@Component( + service = [UtxoLedgerTransactionFactory::class, UsedByFlow::class], + scope = PROTOTYPE, + property = [CORDA_SYSTEM_SERVICE], +) +class UtxoLedgerTransactionFactoryOsgiImpl( + delegate: UtxoLedgerTransactionFactory +) : UtxoLedgerTransactionFactory by delegate, UsedByFlow, SingletonSerializeAsToken { + + @Suppress("Unused") + @Activate + constructor( + @Reference(service = SerializationService::class) + serializationService: SerializationService, + @Reference(service = UtxoLedgerStateQueryService::class) + utxoLedgerStateQueryService: UtxoLedgerStateQueryService, + @Reference(service = UtxoLedgerGroupParametersPersistenceService::class) + utxoLedgerGroupParametersPersistenceService: UtxoLedgerGroupParametersPersistenceService, + @Reference(service = GroupParametersLookupInternal::class) + groupParametersLookup: GroupParametersLookupInternal + ) : this( + UtxoLedgerTransactionFactoryImpl( + serializationService, + utxoLedgerStateQueryService, + utxoLedgerGroupParametersPersistenceService, + groupParametersLookup + ) + ) +} diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt new file mode 100644 index 00000000000..c6703ac1965 --- /dev/null +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt @@ -0,0 +1,83 @@ +package net.corda.ledger.utxo.flow.impl.transaction.factory.impl + +import net.corda.flow.application.GroupParametersLookupInternal +import net.corda.ledger.common.data.transaction.factory.WireTransactionFactory +import net.corda.ledger.common.flow.transaction.PrivacySaltProviderService +import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal +import net.corda.ledger.common.flow.transaction.factory.TransactionMetadataFactory +import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoSignedTransactionFactoryImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService +import net.corda.libs.json.validator.JsonValidator +import net.corda.sandbox.type.UsedByFlow +import net.corda.sandboxgroupcontext.CurrentSandboxGroupContext +import net.corda.v5.application.marshalling.JsonMarshallingService +import net.corda.v5.application.serialization.SerializationService +import net.corda.v5.serialization.SingletonSerializeAsToken +import org.osgi.service.component.annotations.Activate +import org.osgi.service.component.annotations.Component +import org.osgi.service.component.annotations.Reference +import org.osgi.service.component.annotations.ReferenceScope.PROTOTYPE_REQUIRED +import org.osgi.service.component.annotations.ServiceScope + +@Suppress("LongParameterList") +@Component(service = [UtxoSignedTransactionFactory::class, UsedByFlow::class], scope = ServiceScope.PROTOTYPE) +class UtxoSignedTransactionFactoryOsgiImpl( + delegate: UtxoSignedTransactionFactory +) : + UtxoSignedTransactionFactory by delegate, UsedByFlow, SingletonSerializeAsToken { + + @Suppress("Unused") + @Activate + constructor( + @Reference(service = CurrentSandboxGroupContext::class) + currentSandboxGroupContext: CurrentSandboxGroupContext, + @Reference(service = JsonMarshallingService::class, scope = PROTOTYPE_REQUIRED) + jsonMarshallingService: JsonMarshallingService, + @Reference(service = JsonValidator::class, scope = PROTOTYPE_REQUIRED) + jsonValidator: JsonValidator, + @Reference(service = SerializationService::class) + serializationService: SerializationService, + @Reference(service = TransactionSignatureServiceInternal::class) + transactionSignatureService: TransactionSignatureServiceInternal, + @Reference(service = TransactionMetadataFactory::class) + transactionMetadataFactory: TransactionMetadataFactory, + @Reference(service = WireTransactionFactory::class) + wireTransactionFactory: WireTransactionFactory, + @Reference(service = UtxoLedgerTransactionFactory::class) + utxoLedgerTransactionFactory: UtxoLedgerTransactionFactory, + @Reference(service = UtxoLedgerTransactionVerificationService::class) + utxoLedgerTransactionVerificationService: UtxoLedgerTransactionVerificationService, + @Reference(service = UtxoLedgerGroupParametersPersistenceService::class) + utxoLedgerGroupParametersPersistenceService: UtxoLedgerGroupParametersPersistenceService, + @Reference(service = GroupParametersLookupInternal::class) + groupParametersLookup: GroupParametersLookupInternal, + @Reference(service = SignedGroupParametersVerifier::class) + signedGroupParametersVerifier: SignedGroupParametersVerifier, + @Reference(service = NotarySignatureVerificationServiceInternal::class) + notarySignatureVerificationService: NotarySignatureVerificationServiceInternal, + @Reference(service = PrivacySaltProviderService::class) + privacySaltProviderService: PrivacySaltProviderService + ) : this( + UtxoSignedTransactionFactoryImpl( + currentSandboxGroupContext, + jsonMarshallingService, + jsonValidator, + serializationService, + transactionSignatureService, + transactionMetadataFactory, + wireTransactionFactory, + utxoLedgerTransactionFactory, + utxoLedgerTransactionVerificationService, + utxoLedgerGroupParametersPersistenceService, + groupParametersLookup, + signedGroupParametersVerifier, + notarySignatureVerificationService, + privacySaltProviderService + ) + ) +} diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/UtxoFilteredTransactionBuilderImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/UtxoFilteredTransactionBuilderImpl.kt index 6243352238e..6a90caa8a31 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/UtxoFilteredTransactionBuilderImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/UtxoFilteredTransactionBuilderImpl.kt @@ -2,8 +2,8 @@ package net.corda.ledger.utxo.flow.impl.transaction.filtered import net.corda.ledger.common.data.transaction.filtered.ComponentGroupFilterParameters import net.corda.ledger.common.data.transaction.filtered.ComponentGroupFilterParameters.AuditProof.AuditProofPredicate +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.data.transaction.UtxoComponentGroup -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.transaction.filtered.factory.UtxoFilteredTransactionFactory import net.corda.v5.base.annotations.Suspendable import net.corda.v5.ledger.utxo.Command diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactory.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactory.kt index aeeda268a33..6b4ffc241d1 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactory.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactory.kt @@ -1,7 +1,7 @@ package net.corda.ledger.utxo.flow.impl.transaction.filtered.factory import net.corda.ledger.common.data.transaction.filtered.FilteredTransaction -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.transaction.filtered.UtxoFilteredTransactionBuilderInternal import net.corda.v5.base.annotations.Suspendable import net.corda.v5.ledger.utxo.transaction.filtered.UtxoFilteredTransaction diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactoryImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactoryImpl.kt index b2338b64794..7e09a584901 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactoryImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactoryImpl.kt @@ -4,11 +4,11 @@ import net.corda.ledger.common.data.transaction.filtered.ComponentGroupFilterPar import net.corda.ledger.common.data.transaction.filtered.ComponentGroupFilterParameters.AuditProof.AuditProofPredicate import net.corda.ledger.common.data.transaction.filtered.FilteredTransaction import net.corda.ledger.common.data.transaction.filtered.factory.FilteredTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.data.transaction.UtxoComponentGroup import net.corda.ledger.utxo.data.transaction.UtxoComponentGroup.METADATA import net.corda.ledger.utxo.data.transaction.UtxoComponentGroup.NOTARY import net.corda.ledger.utxo.data.transaction.UtxoOutputInfoComponent -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.transaction.filtered.UtxoFilteredTransactionBuilderInternal import net.corda.ledger.utxo.flow.impl.transaction.filtered.UtxoFilteredTransactionImpl import net.corda.sandbox.type.SandboxConstants diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoSignedTransactionSerializer.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoSignedTransactionSerializer.kt index cb75e7e83d6..91bda742069 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoSignedTransactionSerializer.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoSignedTransactionSerializer.kt @@ -2,10 +2,10 @@ package net.corda.ledger.utxo.flow.impl.transaction.serializer.amqp import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.sandbox.type.SandboxConstants.CORDA_UNINJECTABLE_SERVICE import net.corda.sandbox.type.UsedByFlow import net.corda.serialization.BaseProxySerializer diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoTransactionBuilderSerializer.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoTransactionBuilderSerializer.kt index 6f96d246041..924a4e8d9f6 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoTransactionBuilderSerializer.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoTransactionBuilderSerializer.kt @@ -1,6 +1,6 @@ package net.corda.ledger.utxo.flow.impl.transaction.serializer.amqp -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.sandbox.type.SandboxConstants.CORDA_UNINJECTABLE_SERVICE import net.corda.sandbox.type.UsedByFlow import net.corda.serialization.BaseProxySerializer diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedLedgerTransactionKryoSerializer.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedLedgerTransactionKryoSerializer.kt index 34632dabaa5..cac4e6e9ee6 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedLedgerTransactionKryoSerializer.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedLedgerTransactionKryoSerializer.kt @@ -1,9 +1,9 @@ package net.corda.ledger.utxo.flow.impl.transaction.serializer.kryo +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoSignedLedgerTransactionImpl import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransactionImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.sandbox.type.SandboxConstants.CORDA_UNINJECTABLE_SERVICE import net.corda.sandbox.type.UsedByFlow import net.corda.serialization.checkpoint.CheckpointInput diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedTransactionKryoSerializer.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedTransactionKryoSerializer.kt index 9b5d6a6a93c..575a83d5d21 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedTransactionKryoSerializer.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedTransactionKryoSerializer.kt @@ -2,10 +2,10 @@ package net.corda.ledger.utxo.flow.impl.transaction.serializer.kryo import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.sandbox.type.SandboxConstants.CORDA_UNINJECTABLE_SERVICE import net.corda.sandbox.type.UsedByFlow import net.corda.serialization.checkpoint.CheckpointInput diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt index 703821a2b00..596bee4f85e 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt @@ -1,6 +1,7 @@ package net.corda.ledger.utxo.flow.impl.transaction.verifier import net.corda.ledger.common.flow.transaction.TransactionSignatureVerificationServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.sandbox.type.UsedByFlow import net.corda.sandbox.type.UsedByVerification import net.corda.v5.application.crypto.DigitalSignatureAndMetadata diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/external/events/TransactionVerificationExternalEventFactory.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/TransactionVerificationExternalEventFactory.kt similarity index 97% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/external/events/TransactionVerificationExternalEventFactory.kt rename to components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/TransactionVerificationExternalEventFactory.kt index 19b8d98e3fd..26a56ec744b 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/external/events/TransactionVerificationExternalEventFactory.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/TransactionVerificationExternalEventFactory.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction.verifier.external.events +package net.corda.ledger.utxo.flow.impl.transaction.verifier import net.corda.data.flow.event.external.ExternalEventContext import net.corda.flow.external.events.factory.ExternalEventFactory diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilder.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoBaselinedTransactionBuilder.kt similarity index 94% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilder.kt rename to components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoBaselinedTransactionBuilder.kt index 2c255954691..d2f19c9a23f 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilder.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoBaselinedTransactionBuilder.kt @@ -1,7 +1,11 @@ -package net.corda.ledger.utxo.flow.impl.transaction - -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowBetweenImpl -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowUntilImpl +package net.corda.ledger.utxo.flow.impl.transaction.verifier + +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowBetweenImpl +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowUntilImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderData +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.v5.base.annotations.Suspendable import net.corda.v5.base.types.MemberX500Name import net.corda.v5.ledger.utxo.Command diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImpl.kt index d2d220326b5..a3bf8b60df0 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImpl.kt @@ -4,12 +4,11 @@ import io.micrometer.core.instrument.Timer import net.corda.flow.external.events.executor.ExternalEventExecutor import net.corda.flow.fiber.metrics.recordSuspendable import net.corda.ledger.common.data.transaction.TransactionMetadataInternal +import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.data.transaction.TransactionVerificationStatus import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionContainer import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal -import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier -import net.corda.ledger.utxo.flow.impl.transaction.verifier.external.events.TransactionVerificationExternalEventFactory -import net.corda.ledger.utxo.flow.impl.transaction.verifier.external.events.TransactionVerificationParameters import net.corda.membership.lib.SignedGroupParameters import net.corda.metrics.CordaMetrics import net.corda.sandbox.type.SandboxConstants.CORDA_SYSTEM_SERVICE diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/UtxoLedgerServiceImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/UtxoLedgerServiceImplTest.kt index 6aacd9ca5bd..e64f39add21 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/UtxoLedgerServiceImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/UtxoLedgerServiceImplTest.kt @@ -1,8 +1,8 @@ package net.corda.ledger.utxo.flow.impl import net.corda.ledger.common.testkit.publicKeyExample -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionWithDependencies +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoSignedTransactionWithDependencies import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.UtxoStateClassExample diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/TransactionBackchainVerifierImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/TransactionBackchainVerifierImplTest.kt index a39bf1d7e0f..a8fc9ca2ee6 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/TransactionBackchainVerifierImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/TransactionBackchainVerifierImplTest.kt @@ -5,11 +5,11 @@ import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.data.transaction.TransactionStatus.UNVERIFIED import net.corda.ledger.common.data.transaction.TransactionStatus.VERIFIED import net.corda.ledger.common.flow.transaction.TransactionMissingSignaturesException +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.data.transaction.TransactionVerificationStatus import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction import net.corda.ledger.utxo.flow.impl.transaction.verifier.TransactionVerificationException -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.testkit.getExampleInvalidStateAndRefImpl import net.corda.ledger.utxo.testkit.getExampleStateAndRefImpl import net.corda.v5.base.exceptions.CordaRuntimeException diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1Test.kt index 4456bb33a53..529c409a4db 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1Test.kt @@ -6,14 +6,14 @@ import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.common.data.transaction.TransactionStatus.INVALID import net.corda.ledger.common.data.transaction.TransactionStatus.UNVERIFIED import net.corda.ledger.common.data.transaction.TransactionStatus.VERIFIED +import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction import net.corda.ledger.utxo.flow.impl.UtxoLedgerMetricRecorder import net.corda.ledger.utxo.flow.impl.flows.backchain.InvalidBackchainException import net.corda.ledger.utxo.flow.impl.flows.backchain.TopologicalSort -import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier import net.corda.ledger.utxo.flow.impl.persistence.TransactionExistenceStatus -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction import net.corda.libs.configuration.SmartConfig import net.corda.membership.lib.SignedGroupParameters import net.corda.schema.configuration.ConfigKeys diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/common/SendTransactionFlowTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/common/SendTransactionFlowTest.kt index a581c24f34c..c2bff167bcd 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/common/SendTransactionFlowTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/common/SendTransactionFlowTest.kt @@ -3,11 +3,11 @@ package net.corda.ledger.utxo.flow.impl.flows.common import net.corda.crypto.core.SecureHashImpl import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.flow.flows.Payload +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainSenderFlow import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.SendTransactionFlow import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.UtxoTransactionPayload import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.testkit.notaryX500Name import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.application.flows.FlowEngine diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlowVersionedFlowFactoryTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlowVersionedFlowFactoryTest.kt index bd285192ecd..fb710ea2885 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlowVersionedFlowFactoryTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/UtxoFinalityFlowVersionedFlowFactoryTest.kt @@ -1,8 +1,8 @@ package net.corda.ledger.utxo.flow.impl.flows.finality +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.flows.finality.v1.UtxoFinalityFlowV1 import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryDetails -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.libs.platform.PlatformVersion.CORDA_5_1 import net.corda.v5.base.exceptions.CordaRuntimeException import net.corda.v5.ledger.notary.plugin.api.PluggableNotaryClientFlow diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityFlowV1Test.kt index 971bae19eb0..be755b40df0 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoFinalityFlowV1Test.kt @@ -11,14 +11,14 @@ import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.flow.flows.Payload import net.corda.ledger.common.flow.transaction.TransactionMissingSignaturesException import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.data.transaction.TransactionVerificationStatus import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainSenderFlow import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryDetails import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.transaction.verifier.TransactionVerificationException -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.getUtxoStateExample import net.corda.ledger.utxo.testkit.notaryX500Name diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1Test.kt index 81b7cbbf33d..159fff3f387 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1Test.kt @@ -12,6 +12,11 @@ import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.flow.flows.Payload import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.data.state.StateAndRefImpl import net.corda.ledger.utxo.data.state.TransactionStateImpl import net.corda.ledger.utxo.data.transaction.TransactionVerificationStatus @@ -21,14 +26,9 @@ import net.corda.ledger.utxo.data.transaction.verifyFilteredTransactionAndSignat import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainResolutionFlow import net.corda.ledger.utxo.flow.impl.flows.backchain.dependencies import net.corda.ledger.utxo.flow.impl.flows.finality.FinalityPayload -import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.external.events.FindUnconsumedStatesByTypeExternalEventFactoryTest.TestContractState -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.ledger.utxo.flow.impl.transaction.verifier.TransactionVerificationException -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.anotherNotaryX500Name import net.corda.ledger.utxo.testkit.getExampleInvalidStateAndRefImpl diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/repair/UtxoLedgerRepairFlowTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/repair/UtxoLedgerRepairFlowTest.kt index fa4437cff9d..48a9759bf3a 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/repair/UtxoLedgerRepairFlowTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/repair/UtxoLedgerRepairFlowTest.kt @@ -4,10 +4,10 @@ import net.corda.ledger.common.data.transaction.TransactionStatus.INVALID import net.corda.ledger.common.data.transaction.TransactionStatus.UNVERIFIED import net.corda.ledger.common.data.transaction.TransactionStatus.VERIFIED import net.corda.ledger.common.flow.transaction.TransactionMissingSignaturesException +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryDetails import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.impl.token.selection.impl.ALICE_X500_NAME import net.corda.ledger.utxo.impl.token.selection.impl.BOB_X500_NAME import net.corda.utilities.minutes diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/ReceiveAndUpdateTransactionBuilderFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/ReceiveAndUpdateTransactionBuilderFlowV1Test.kt index 5c25f8f5642..57a88e9360f 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/ReceiveAndUpdateTransactionBuilderFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/ReceiveAndUpdateTransactionBuilderFlowV1Test.kt @@ -4,12 +4,12 @@ import net.corda.crypto.core.SecureHashImpl import net.corda.ledger.common.testkit.anotherPublicKeyExample import net.corda.ledger.common.testkit.getSignatureWithMetadataExample import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowUntilImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainResolutionFlow import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowUntilImpl -import net.corda.ledger.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.UtxoStateClassExample diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/SendTransactionBuilderDiffFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/SendTransactionBuilderDiffFlowV1Test.kt index a6e23ab203f..c6a73a46135 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/SendTransactionBuilderDiffFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactionbuilder/v1/SendTransactionBuilderDiffFlowV1Test.kt @@ -3,14 +3,14 @@ package net.corda.ledger.utxo.flow.impl.flows.transactionbuilder.v1 import net.corda.crypto.core.SecureHashImpl import net.corda.ledger.common.testkit.anotherPublicKeyExample import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowUntilImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainSenderFlow import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerStateQueryService -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowUntilImpl -import net.corda.ledger.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag -import net.corda.ledger.utxo.flow.impl.transaction.UtxoBaselinedTransactionBuilder -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoBaselinedTransactionBuilder import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.anotherNotaryX500Name import net.corda.ledger.utxo.testkit.notaryX500Name diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/ReceiveSignedTransactionFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/ReceiveSignedTransactionFlowV1Test.kt index da967582914..9a6f905d5af 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/ReceiveSignedTransactionFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/ReceiveSignedTransactionFlowV1Test.kt @@ -2,12 +2,12 @@ package net.corda.ledger.utxo.flow.impl.flows.transactiontransmission import net.corda.crypto.core.SecureHashImpl import net.corda.ledger.common.flow.flows.Payload +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.TransactionDependencyResolutionFlow import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.UtxoTransactionPayload import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.v1.ReceiveSignedTransactionFlowV1 import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.notaryX500Name import net.corda.v5.application.flows.FlowEngine diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/ReceiveWireTransactionFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/ReceiveWireTransactionFlowV1Test.kt index 4abff011d46..8b117f3ae4b 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/ReceiveWireTransactionFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/ReceiveWireTransactionFlowV1Test.kt @@ -3,11 +3,11 @@ package net.corda.ledger.utxo.flow.impl.flows.transactiontransmission import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.flow.flows.Payload import net.corda.ledger.common.testkit.getWireTransactionExample +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoLedgerTransactionFactoryImpl import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.TransactionDependencyResolutionFlow import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.UtxoTransactionPayload import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.v1.ReceiveWireTransactionFlowV1 -import net.corda.ledger.utxo.flow.impl.transaction.factory.impl.UtxoLedgerTransactionFactoryImpl import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.notaryX500Name import net.corda.ledger.utxo.testkit.utxoTransactionMetadataExample diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/SendSignedTransactionFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/SendSignedTransactionFlowV1Test.kt index 739f04f169e..7e7aab0a84d 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/SendSignedTransactionFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/SendSignedTransactionFlowV1Test.kt @@ -1,9 +1,9 @@ package net.corda.ledger.utxo.flow.impl.flows.transactiontransmission import net.corda.crypto.core.SecureHashImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.SendTransactionFlow import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.v1.SendSignedTransactionFlowV1 -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.testkit.notaryX500Name import net.corda.v5.application.flows.FlowEngine import net.corda.v5.application.messaging.FlowSession diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/SendWireTransactionFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/SendWireTransactionFlowV1Test.kt index a79de1f9566..42f21c6230a 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/SendWireTransactionFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/transactiontransmission/SendWireTransactionFlowV1Test.kt @@ -2,9 +2,9 @@ package net.corda.ledger.utxo.flow.impl.flows.transactiontransmission import net.corda.crypto.core.SecureHashImpl import net.corda.ledger.common.data.transaction.WireTransaction +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.common.SendTransactionFlow import net.corda.ledger.utxo.flow.impl.flows.transactiontransmission.v1.SendWireTransactionFlowV1 -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.testkit.notaryX500Name import net.corda.v5.application.flows.FlowEngine import net.corda.v5.application.messaging.FlowSession diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceServiceImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceServiceImplTest.kt index 229ee99a98b..aa294504e2d 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceServiceImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerPersistenceServiceImplTest.kt @@ -14,6 +14,12 @@ import net.corda.ledger.common.data.transaction.TransactionStatus.VERIFIED import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.data.transaction.filtered.FilteredTransaction import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoSignedLedgerTransactionImpl import net.corda.ledger.utxo.data.transaction.SignedLedgerTransactionContainer import net.corda.ledger.utxo.data.transaction.UtxoComponentGroup import net.corda.ledger.utxo.data.transaction.UtxoFilteredTransactionAndSignaturesImpl @@ -30,14 +36,8 @@ import net.corda.ledger.utxo.flow.impl.persistence.external.events.FindTransacti import net.corda.ledger.utxo.flow.impl.persistence.external.events.PersistFilteredTransactionsExternalEventFactory import net.corda.ledger.utxo.flow.impl.persistence.external.events.PersistTransactionExternalEventFactory import net.corda.ledger.utxo.flow.impl.persistence.external.events.PersistTransactionIfDoesNotExistExternalEventFactory -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedLedgerTransactionImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory import net.corda.ledger.utxo.flow.impl.transaction.filtered.UtxoFilteredTransactionImpl import net.corda.ledger.utxo.flow.impl.transaction.filtered.factory.UtxoFilteredTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.ledger.utxo.testkit.notaryX500Name import net.corda.sandboxgroupcontext.CurrentSandboxGroupContext import net.corda.sandboxgroupcontext.SandboxGroupContext diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilderDiffTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilderDiffTest.kt index 0bd02f9b52b..f57e1112e8f 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilderDiffTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilderDiffTest.kt @@ -3,6 +3,10 @@ package net.corda.ledger.utxo.flow.impl.transaction import net.corda.crypto.core.SecureHashImpl import net.corda.ledger.common.testkit.anotherPublicKeyExample import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoBaselinedTransactionBuilder import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.UtxoStateClassExample diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilderTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilderTest.kt index d9578a79d9d..32661f3d057 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilderTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoBaselinedTransactionBuilderTest.kt @@ -1,5 +1,6 @@ package net.corda.ledger.utxo.flow.impl.transaction +import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoBaselinedTransactionBuilder import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.anotherNotaryX500Name import net.corda.ledger.utxo.testkit.notaryX500Name diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoLedgerTransactionImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoLedgerTransactionImplTest.kt index 303b1c15491..7b546934a9c 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoLedgerTransactionImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoLedgerTransactionImplTest.kt @@ -1,6 +1,7 @@ package net.corda.ledger.utxo.flow.impl.transaction import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.UtxoStateClassExample diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionImplTest.kt index 2b5f8e4c78f..de3cfcb2b79 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionImplTest.kt @@ -3,6 +3,8 @@ package net.corda.ledger.utxo.flow.impl.transaction import net.corda.crypto.impl.CompositeKeyProviderImpl import net.corda.ledger.common.testkit.anotherPublicKeyExample import net.corda.ledger.common.testkit.getSignatureWithMetadataExample +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.getUtxoStateExample diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImplAppendTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImplAppendTest.kt index da7d9c31a26..a2b4e9d5801 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImplAppendTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImplAppendTest.kt @@ -3,7 +3,10 @@ package net.corda.ledger.utxo.flow.impl.transaction import net.corda.crypto.core.SecureHashImpl import net.corda.ledger.common.testkit.anotherPublicKeyExample import net.corda.ledger.common.testkit.publicKeyExample -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowUntilImpl +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowUntilImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderContainer +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.UtxoStateClassExample diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImplTest.kt index 8474863ce6f..ba91fca14fc 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImplTest.kt @@ -5,6 +5,9 @@ import net.corda.ledger.common.data.transaction.CordaPackageSummaryImpl import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.common.test.dummyCpkSignerSummaryHash import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.UtxoStateClassExample diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactoryImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactoryImplTest.kt index 285c3c964c3..184746e38a8 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactoryImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/filtered/factory/UtxoFilteredTransactionFactoryImplTest.kt @@ -3,9 +3,9 @@ package net.corda.ledger.utxo.flow.impl.transaction.filtered.factory import net.corda.ledger.common.data.transaction.filtered.ComponentGroupFilterParameters import net.corda.ledger.common.data.transaction.filtered.factory.FilteredTransactionFactory import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowBetweenImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.data.transaction.UtxoComponentGroup -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowBetweenImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.flow.impl.transaction.filtered.UtxoFilteredTransactionBuilderImpl import net.corda.ledger.utxo.flow.impl.transaction.filtered.UtxoFilteredTransactionBuilderInternal import net.corda.ledger.utxo.test.UtxoLedgerTest diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoTransactionBuilderSerializerTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoTransactionBuilderSerializerTest.kt index 7ec5c17f8c4..00123a4205c 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoTransactionBuilderSerializerTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/amqp/UtxoTransactionBuilderSerializerTest.kt @@ -1,6 +1,6 @@ package net.corda.ledger.utxo.flow.impl.transaction.serializer.amqp -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl import net.corda.v5.base.exceptions.CordaRuntimeException import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.jupiter.api.Test diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedTransactionKryoSerializerTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedTransactionKryoSerializerTest.kt index 7cbada73904..ed0b48d5494 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedTransactionKryoSerializerTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/kryo/UtxoSignedTransactionKryoSerializerTest.kt @@ -5,7 +5,7 @@ import net.corda.crypto.core.DigitalSignatureWithKeyId import net.corda.kryoserialization.testkit.createCheckpointSerializer import net.corda.ledger.common.data.transaction.PrivacySaltImpl import net.corda.ledger.common.data.transaction.WireTransaction -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionImpl import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.crypto.DigitalSignature diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImplTest.kt index 2e70ff66d52..f9e47233708 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImplTest.kt @@ -6,12 +6,11 @@ import net.corda.internal.serialization.SerializedBytesImpl import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.data.transaction.TransactionVerificationResult import net.corda.ledger.utxo.data.transaction.TransactionVerificationStatus import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.external.events.ALICE_X500_HOLDING_IDENTITY -import net.corda.ledger.utxo.flow.impl.transaction.verifier.external.events.TransactionVerificationExternalEventFactory import net.corda.ledger.utxo.testkit.notaryX500Name import net.corda.membership.lib.SignedGroupParameters import net.corda.sandboxgroupcontext.CurrentSandboxGroupContext diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifierTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifierTest.kt index b749f2c1c4d..844446cdba5 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifierTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifierTest.kt @@ -1,8 +1,9 @@ package net.corda.ledger.utxo.flow.impl.transaction.verifier import net.corda.ledger.common.testkit.publicKeyExample -import net.corda.ledger.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.ContractStateAndEncumbranceTag +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoTransactionBuilderVerifier import net.corda.ledger.utxo.testkit.notaryX500Name import net.corda.v5.ledger.utxo.Command import net.corda.v5.ledger.utxo.ContractState diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/external/events/TransactionVerificationExternalEventFactoryTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/external/events/TransactionVerificationExternalEventFactoryTest.kt index f863114b3a7..bf8995d561c 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/external/events/TransactionVerificationExternalEventFactoryTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/external/events/TransactionVerificationExternalEventFactoryTest.kt @@ -5,6 +5,9 @@ import net.corda.data.flow.event.external.ExternalEventContext import net.corda.flow.state.FlowCheckpoint import net.corda.ledger.common.data.transaction.CordaPackageSummaryImpl import net.corda.ledger.utxo.flow.impl.persistence.external.events.ALICE_X500_HOLDING_IDENTITY +import net.corda.ledger.utxo.flow.impl.transaction.verifier.TransactionVerificationExternalEventFactory +import net.corda.ledger.utxo.flow.impl.transaction.verifier.TransactionVerificationParameters +import net.corda.ledger.utxo.flow.impl.transaction.verifier.toAvro import net.corda.ledger.utxo.verification.TransactionVerificationRequest import net.corda.v5.ledger.common.transaction.CordaPackageSummary import net.corda.virtualnode.toCorda diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/serialization/DigitalSignatureAndMetadataJsonSerializationTests.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/serialization/DigitalSignatureAndMetadataJsonSerializationTests.kt index ab3d433f5f9..a71696b45aa 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/serialization/DigitalSignatureAndMetadataJsonSerializationTests.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/serialization/DigitalSignatureAndMetadataJsonSerializationTests.kt @@ -22,8 +22,8 @@ import net.corda.crypto.merkle.impl.MerkleProofProviderImpl import net.corda.ledger.common.testkit.anotherPublicKeyExample import net.corda.ledger.common.testkit.getSignatureWithMetadataExample import net.corda.ledger.common.testkit.publicKeyExample -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl import net.corda.ledger.utxo.test.UtxoLedgerTest import net.corda.ledger.utxo.testkit.UtxoCommandExample import net.corda.ledger.utxo.testkit.getUtxoStateExample diff --git a/libs/ledger-lib-utxo-flow/build.gradle b/libs/ledger-lib-utxo-flow/build.gradle new file mode 100644 index 00000000000..9c400c11cd1 --- /dev/null +++ b/libs/ledger-lib-utxo-flow/build.gradle @@ -0,0 +1,37 @@ +plugins { + id 'corda.common-publishing' + id 'corda.common-library' +} + +description 'Corda Ledger UXTO Flow library' + +ext.cordaEnableFormatting = true + +dependencies { + compileOnly 'org.osgi:osgi.annotation' + + implementation platform("net.corda:corda-api:$cordaApiVersion") + + implementation project(':libs:ledger:ledger-common-data') + implementation project(':libs:ledger:ledger-utxo-data') + implementation project(':libs:ledger:ledger-utxo-transaction-verifier') + + //Should we rename components:ledger:ledger-common-flow-api to libs:ledger:ledger-common-flow-api etc. + implementation project(':components:ledger:ledger-common-flow-api') + implementation project(':components:ledger:ledger-common-flow') + + //This will be removed in a future commit + implementation project(':libs:membership:membership-common') + //This will be removed in a future commit + implementation project(':libs:flows:flow-api') + //This will be removed in a future commit + implementation project(':libs:serialization:json-validator') + implementation project(':libs:serialization:json-validator-lib') + //This will be removed in a future commit + implementation project(':libs:virtual-node:sandbox-group-context') + + implementation 'net.corda:corda-ledger-utxo' + implementation 'net.corda:corda-base' + + implementation 'org.jetbrains.kotlin:kotlin-stdlib' +} diff --git a/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/groupparameters/package-info.java b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/groupparameters/package-info.java new file mode 100644 index 00000000000..7712e0a2de9 --- /dev/null +++ b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/groupparameters/package-info.java @@ -0,0 +1,4 @@ +@Export +package net.corda.ledger.lib.utxo.flow.impl.groupparameters; + +import org.osgi.annotation.bundle.Export; diff --git a/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/persistence/package-info.java b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/persistence/package-info.java new file mode 100644 index 00000000000..93eb1fe1024 --- /dev/null +++ b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/persistence/package-info.java @@ -0,0 +1,4 @@ +@Export +package net.corda.ledger.lib.utxo.flow.impl.persistence; + +import org.osgi.annotation.bundle.Export; diff --git a/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/timewindow/package-info.java b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/timewindow/package-info.java new file mode 100644 index 00000000000..d2d7d9d11d9 --- /dev/null +++ b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/timewindow/package-info.java @@ -0,0 +1,4 @@ +@Export +package net.corda.ledger.lib.utxo.flow.impl.timewindow; + +import org.osgi.annotation.bundle.Export; diff --git a/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/package-info.java b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/package-info.java new file mode 100644 index 00000000000..b98eadeaff4 --- /dev/null +++ b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/package-info.java @@ -0,0 +1,4 @@ +@Export +package net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl; + +import org.osgi.annotation.bundle.Export; diff --git a/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/package-info.java b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/package-info.java new file mode 100644 index 00000000000..0fb5bcf5fc7 --- /dev/null +++ b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/package-info.java @@ -0,0 +1,4 @@ +@Export +package net.corda.ledger.lib.utxo.flow.impl.transaction.factory; + +import org.osgi.annotation.bundle.Export; diff --git a/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/package-info.java b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/package-info.java new file mode 100644 index 00000000000..a2a14add6b4 --- /dev/null +++ b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/package-info.java @@ -0,0 +1,4 @@ +@Export +package net.corda.ledger.lib.utxo.flow.impl.transaction; + +import org.osgi.annotation.bundle.Export; diff --git a/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/package-info.java b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/package-info.java new file mode 100644 index 00000000000..bf54c5862e2 --- /dev/null +++ b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/package-info.java @@ -0,0 +1,4 @@ +@Export +package net.corda.ledger.lib.utxo.flow.impl.transaction.verifier; + +import org.osgi.annotation.bundle.Export; diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifier.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/groupparameters/SignedGroupParametersVerifier.kt similarity index 90% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifier.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/groupparameters/SignedGroupParametersVerifier.kt index 15a3893aba5..ea0744ff6cb 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifier.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/groupparameters/SignedGroupParametersVerifier.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.groupparameters.verifier +package net.corda.ledger.lib.utxo.flow.impl.groupparameters import net.corda.membership.lib.SignedGroupParameters import net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt similarity index 95% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt index 453b079e92a..f4b49999c72 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.persistence +package net.corda.ledger.lib.utxo.flow.impl.persistence import net.corda.membership.lib.SignedGroupParameters import net.corda.v5.application.persistence.CordaPersistenceException diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerStateQueryService.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/persistence/UtxoLedgerStateQueryService.kt similarity index 95% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerStateQueryService.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/persistence/UtxoLedgerStateQueryService.kt index 3d971c56f1f..b837477caa0 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerStateQueryService.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/persistence/UtxoLedgerStateQueryService.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.persistence +package net.corda.ledger.lib.utxo.flow.impl.persistence import net.corda.v5.application.persistence.CordaPersistenceException import net.corda.v5.base.annotations.Suspendable diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/timewindow/TimeWindowBetweenImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/timewindow/TimeWindowBetweenImpl.kt similarity index 93% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/timewindow/TimeWindowBetweenImpl.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/timewindow/TimeWindowBetweenImpl.kt index df4d0ee5406..b4f3c151558 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/timewindow/TimeWindowBetweenImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/timewindow/TimeWindowBetweenImpl.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.timewindow +package net.corda.ledger.lib.utxo.flow.impl.timewindow import net.corda.v5.ledger.utxo.TimeWindow import java.time.Instant diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/timewindow/TimeWindowUntilImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/timewindow/TimeWindowUntilImpl.kt similarity index 95% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/timewindow/TimeWindowUntilImpl.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/timewindow/TimeWindowUntilImpl.kt index 03a68764a95..f4f4750c17b 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/timewindow/TimeWindowUntilImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/timewindow/TimeWindowUntilImpl.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.timewindow +package net.corda.ledger.lib.utxo.flow.impl.timewindow import net.corda.v5.ledger.utxo.TimeWindow import java.time.Instant diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/ContractStateAndEncumbranceTag.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/ContractStateAndEncumbranceTag.kt similarity index 94% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/ContractStateAndEncumbranceTag.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/ContractStateAndEncumbranceTag.kt index 7286a247b44..f4a16739288 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/ContractStateAndEncumbranceTag.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/ContractStateAndEncumbranceTag.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction import net.corda.ledger.utxo.data.state.EncumbranceGroupImpl import net.corda.ledger.utxo.data.state.TransactionStateImpl diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedLedgerTransaction.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoSignedLedgerTransaction.kt similarity index 93% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedLedgerTransaction.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoSignedLedgerTransaction.kt index 6af1773093e..2ead3228520 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedLedgerTransaction.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoSignedLedgerTransaction.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal import net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoSignedTransactionImpl.kt similarity index 97% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionImpl.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoSignedTransactionImpl.kt index e7917f81a32..4e82748744c 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoSignedTransactionImpl.kt @@ -1,12 +1,12 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.flow.transaction.TransactionMissingSignaturesException import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.ledger.utxo.data.transaction.WrappedUtxoWireTransaction import net.corda.ledger.utxo.data.transaction.verifier.verifyMetadata -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.application.serialization.SerializationService import net.corda.v5.base.annotations.Suspendable diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionInternal.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoSignedTransactionInternal.kt similarity index 98% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionInternal.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoSignedTransactionInternal.kt index f74363e8c7e..ee86773f3ab 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionInternal.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoSignedTransactionInternal.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction import net.corda.ledger.common.data.transaction.SignedTransactionContainer import net.corda.ledger.common.data.transaction.WireTransaction diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderContainer.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderContainer.kt similarity index 93% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderContainer.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderContainer.kt index 8da5c35f644..0ba2c42e86a 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderContainer.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderContainer.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction import net.corda.v5.base.annotations.CordaSerializable import net.corda.v5.base.types.MemberX500Name diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderData.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderData.kt similarity index 93% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderData.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderData.kt index d25a1933916..16c86c80e38 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderData.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderData.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction import net.corda.v5.base.types.MemberX500Name import net.corda.v5.crypto.SecureHash diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt similarity index 88% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt index b15e3da9389..8e4ce4c9561 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt @@ -1,9 +1,9 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowBetweenImpl -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowUntilImpl -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoTransactionBuilderVerifier +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowBetweenImpl +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowUntilImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoTransactionBuilderVerifier import net.corda.v5.base.annotations.Suspendable import net.corda.v5.base.types.MemberX500Name import net.corda.v5.ledger.common.NotaryLookup @@ -13,19 +13,16 @@ import net.corda.v5.ledger.utxo.StateRef import net.corda.v5.ledger.utxo.TimeWindow import net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction import net.corda.v5.ledger.utxo.transaction.UtxoTransactionBuilder -import java.security.PublicKey -import java.time.Instant -import java.util.Objects @Suppress("TooManyFunctions", "LongParameterList") class UtxoTransactionBuilderImpl( private val utxoSignedTransactionFactory: UtxoSignedTransactionFactory, private val notaryLookup: NotaryLookup, private var notaryName: MemberX500Name? = null, - private var notaryKey: PublicKey? = null, + private var notaryKey: java.security.PublicKey? = null, override var timeWindow: TimeWindow? = null, override val commands: MutableList = mutableListOf(), - override val signatories: MutableList = mutableListOf(), + override val signatories: MutableList = mutableListOf(), override val inputStateRefs: MutableList = mutableListOf(), override val referenceStateRefs: MutableList = mutableListOf(), override val outputStates: MutableList = mutableListOf() @@ -38,7 +35,7 @@ class UtxoTransactionBuilderImpl( return this } - override fun addSignatories(signatories: Iterable): UtxoTransactionBuilder { + override fun addSignatories(signatories: Iterable): UtxoTransactionBuilder { require( this.signatories.intersect(signatories.toSet()).isEmpty() && signatories.distinct().size == signatories.count() @@ -49,7 +46,7 @@ class UtxoTransactionBuilderImpl( return this } - override fun addSignatories(vararg signatories: PublicKey): UtxoTransactionBuilder { + override fun addSignatories(vararg signatories: java.security.PublicKey): UtxoTransactionBuilder { return addSignatories(signatories.toList()) } @@ -150,16 +147,16 @@ class UtxoTransactionBuilderImpl( return this } - override fun getNotaryKey(): PublicKey? { + override fun getNotaryKey(): java.security.PublicKey? { return notaryKey } - override fun setTimeWindowUntil(until: Instant): UtxoTransactionBuilder { + override fun setTimeWindowUntil(until: java.time.Instant): UtxoTransactionBuilder { this.timeWindow = TimeWindowUntilImpl(until) return this } - override fun setTimeWindowBetween(from: Instant, until: Instant): UtxoTransactionBuilder { + override fun setTimeWindowBetween(from: java.time.Instant, until: java.time.Instant): UtxoTransactionBuilder { this.timeWindow = TimeWindowBetweenImpl(from, until) return this } @@ -209,7 +206,7 @@ class UtxoTransactionBuilderImpl( other.signatories == signatories } - override fun hashCode(): Int = Objects.hash( + override fun hashCode(): Int = java.util.Objects.hash( notaryName, notaryKey, timeWindow, @@ -257,7 +254,7 @@ class UtxoTransactionBuilderImpl( ) } - private fun lookUpNotaryKey(notaryName: MemberX500Name?): PublicKey? { + private fun lookUpNotaryKey(notaryName: MemberX500Name?): java.security.PublicKey? { if (notaryName == null) { return null } diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderInternal.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderInternal.kt similarity index 93% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderInternal.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderInternal.kt index ce4891532e0..46c01eac60c 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoTransactionBuilderInternal.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderInternal.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction import net.corda.v5.ledger.utxo.transaction.UtxoTransactionBuilder diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/UtxoLedgerTransactionFactory.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/UtxoLedgerTransactionFactory.kt similarity index 95% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/UtxoLedgerTransactionFactory.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/UtxoLedgerTransactionFactory.kt index 4582cdab3a3..9bc33f5e2b0 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/UtxoLedgerTransactionFactory.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/UtxoLedgerTransactionFactory.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction.factory +package net.corda.ledger.lib.utxo.flow.impl.transaction.factory import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/UtxoSignedTransactionFactory.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/UtxoSignedTransactionFactory.kt similarity index 71% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/UtxoSignedTransactionFactory.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/UtxoSignedTransactionFactory.kt index 6097cae50c3..ed142396ef1 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/UtxoSignedTransactionFactory.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/UtxoSignedTransactionFactory.kt @@ -1,8 +1,8 @@ -package net.corda.ledger.utxo.flow.impl.transaction.factory +package net.corda.ledger.lib.utxo.flow.impl.transaction.factory import net.corda.ledger.common.data.transaction.WireTransaction -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.base.annotations.Suspendable import java.security.PublicKey diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt similarity index 81% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt index 6ca872bddb4..6766f39ee18 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt @@ -1,17 +1,16 @@ -package net.corda.ledger.utxo.flow.impl.transaction.factory.impl +package net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl import net.corda.crypto.core.parseSecureHash import net.corda.flow.application.GroupParametersLookupInternal import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.common.data.transaction.WireTransaction +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionImpl import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal import net.corda.ledger.utxo.data.transaction.UtxoVisibleTransactionOutputDto import net.corda.ledger.utxo.data.transaction.WrappedUtxoWireTransaction -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerStateQueryService -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory -import net.corda.sandbox.type.SandboxConstants.CORDA_SYSTEM_SERVICE import net.corda.sandbox.type.UsedByFlow import net.corda.v5.application.serialization.SerializationService import net.corda.v5.base.annotations.Suspendable @@ -20,24 +19,11 @@ import net.corda.v5.ledger.utxo.ContractState import net.corda.v5.ledger.utxo.StateAndRef import net.corda.v5.membership.GroupParameters import net.corda.v5.serialization.SingletonSerializeAsToken -import org.osgi.service.component.annotations.Activate -import org.osgi.service.component.annotations.Component -import org.osgi.service.component.annotations.Reference -import org.osgi.service.component.annotations.ServiceScope.PROTOTYPE -@Component( - service = [UtxoLedgerTransactionFactory::class, UsedByFlow::class], - scope = PROTOTYPE, - property = [CORDA_SYSTEM_SERVICE], -) -class UtxoLedgerTransactionFactoryImpl @Activate constructor( - @Reference(service = SerializationService::class) +class UtxoLedgerTransactionFactoryImpl( private val serializationService: SerializationService, - @Reference(service = UtxoLedgerStateQueryService::class) private val utxoLedgerStateQueryService: UtxoLedgerStateQueryService, - @Reference(service = UtxoLedgerGroupParametersPersistenceService::class) private val utxoLedgerGroupParametersPersistenceService: UtxoLedgerGroupParametersPersistenceService, - @Reference(service = GroupParametersLookupInternal::class) private val groupParametersLookup: GroupParametersLookupInternal ) : UtxoLedgerTransactionFactory, UsedByFlow, SingletonSerializeAsToken { diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt similarity index 76% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt index 1fe00a418bf..630555a7ed5 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction.factory.impl +package net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl import net.corda.flow.application.GroupParametersLookupInternal import net.corda.ledger.common.data.transaction.TransactionMetadataImpl @@ -7,72 +7,50 @@ import net.corda.ledger.common.data.transaction.factory.WireTransactionFactory import net.corda.ledger.common.flow.transaction.PrivacySaltProviderService import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal import net.corda.ledger.common.flow.transaction.factory.TransactionMetadataFactory +import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.data.transaction.UtxoComponentGroup import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionImpl import net.corda.ledger.utxo.data.transaction.UtxoOutputInfoComponent import net.corda.ledger.utxo.data.transaction.UtxoTransactionMetadata import net.corda.ledger.utxo.data.transaction.utxoComponentGroupStructure import net.corda.ledger.utxo.data.transaction.verifier.verifyMetadata -import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.libs.json.validator.JsonValidator import net.corda.membership.lib.SignedGroupParameters -import net.corda.sandbox.type.UsedByFlow import net.corda.sandboxgroupcontext.CurrentSandboxGroupContext import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.application.marshalling.JsonMarshallingService import net.corda.v5.application.serialization.SerializationService import net.corda.v5.base.annotations.Suspendable import net.corda.v5.ledger.common.transaction.TransactionMetadata -import net.corda.v5.serialization.SingletonSerializeAsToken -import org.osgi.service.component.annotations.Activate -import org.osgi.service.component.annotations.Component -import org.osgi.service.component.annotations.Reference -import org.osgi.service.component.annotations.ReferenceScope.PROTOTYPE_REQUIRED -import org.osgi.service.component.annotations.ServiceScope import java.security.PublicKey // TODO impl impl in package name @Suppress("LongParameterList") -@Component(service = [UtxoSignedTransactionFactory::class, UsedByFlow::class], scope = ServiceScope.PROTOTYPE) -class UtxoSignedTransactionFactoryImpl @Activate constructor( - @Reference(service = CurrentSandboxGroupContext::class) +class UtxoSignedTransactionFactoryImpl( private val currentSandboxGroupContext: CurrentSandboxGroupContext, - @Reference(service = JsonMarshallingService::class, scope = PROTOTYPE_REQUIRED) private val jsonMarshallingService: JsonMarshallingService, - @Reference(service = JsonValidator::class, scope = PROTOTYPE_REQUIRED) private val jsonValidator: JsonValidator, - @Reference(service = SerializationService::class) private val serializationService: SerializationService, - @Reference(service = TransactionSignatureServiceInternal::class) private val transactionSignatureService: TransactionSignatureServiceInternal, - @Reference(service = TransactionMetadataFactory::class) private val transactionMetadataFactory: TransactionMetadataFactory, - @Reference(service = WireTransactionFactory::class) private val wireTransactionFactory: WireTransactionFactory, - @Reference(service = UtxoLedgerTransactionFactory::class) private val utxoLedgerTransactionFactory: UtxoLedgerTransactionFactory, - @Reference(service = UtxoLedgerTransactionVerificationService::class) private val utxoLedgerTransactionVerificationService: UtxoLedgerTransactionVerificationService, - @Reference(service = UtxoLedgerGroupParametersPersistenceService::class) private val utxoLedgerGroupParametersPersistenceService: UtxoLedgerGroupParametersPersistenceService, - @Reference(service = GroupParametersLookupInternal::class) private val groupParametersLookup: GroupParametersLookupInternal, - @Reference(service = SignedGroupParametersVerifier::class) private val signedGroupParametersVerifier: SignedGroupParametersVerifier, - @Reference(service = NotarySignatureVerificationServiceInternal::class) private val notarySignatureVerificationService: NotarySignatureVerificationServiceInternal, - @Reference(service = PrivacySaltProviderService::class) private val privacySaltProviderService: PrivacySaltProviderService -) : UtxoSignedTransactionFactory, UsedByFlow, SingletonSerializeAsToken { +) : UtxoSignedTransactionFactory { @Suspendable override fun create( diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceInternal.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceInternal.kt similarity index 88% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceInternal.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceInternal.kt index df7d8d5ae94..b6df836bd35 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceInternal.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceInternal.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction.verifier +package net.corda.ledger.lib.utxo.flow.impl.transaction.verifier import net.corda.v5.crypto.SecureHash import net.corda.v5.ledger.utxo.NotarySignatureVerificationService diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationService.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationService.kt similarity index 89% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationService.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationService.kt index aadb279ed19..a721a90f21e 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationService.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationService.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.utxo.flow.impl.transaction.verifier +package net.corda.ledger.lib.utxo.flow.impl.transaction.verifier import net.corda.v5.base.annotations.Suspendable import net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedLedgerTransactionImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoSignedLedgerTransactionImpl.kt similarity index 90% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedLedgerTransactionImpl.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoSignedLedgerTransactionImpl.kt index 487aa4e5499..fd24f608069 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedLedgerTransactionImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoSignedLedgerTransactionImpl.kt @@ -1,5 +1,7 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction.verifier +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal import net.corda.v5.base.types.MemberX500Name import net.corda.v5.crypto.SecureHash diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionWithDependencies.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoSignedTransactionWithDependencies.kt similarity index 87% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionWithDependencies.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoSignedTransactionWithDependencies.kt index 643846a6bf4..6f6638dd58c 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/UtxoSignedTransactionWithDependencies.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoSignedTransactionWithDependencies.kt @@ -1,5 +1,6 @@ -package net.corda.ledger.utxo.flow.impl.transaction +package net.corda.ledger.lib.utxo.flow.impl.transaction.verifier +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.base.annotations.Suspendable import net.corda.v5.ledger.utxo.transaction.filtered.UtxoFilteredTransactionAndSignatures diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifier.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifier.kt similarity index 93% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifier.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifier.kt index b8ae7745714..8fde52279dd 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifier.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/UtxoTransactionBuilderVerifier.kt @@ -1,6 +1,6 @@ -package net.corda.ledger.utxo.flow.impl.transaction.verifier +package net.corda.ledger.lib.utxo.flow.impl.transaction.verifier -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal import net.corda.ledger.utxo.transaction.verifier.UtxoTransactionVerifier import net.corda.v5.ledger.utxo.transaction.UtxoTransactionBuilder diff --git a/settings.gradle b/settings.gradle index d5b323bbbea..a00a84bd863 100644 --- a/settings.gradle +++ b/settings.gradle @@ -281,6 +281,8 @@ include 'libs:ledger:ledger-common-data' include 'libs:ledger:ledger-consensual-data' include 'libs:ledger:ledger-utxo-data' include 'libs:ledger:ledger-utxo-transaction-verifier' +include 'libs:ledger-lib-persistence' +include 'libs:ledger-lib-utxo-flow' include 'libs:lifecycle:lifecycle' include 'libs:lifecycle:lifecycle-impl' include 'libs:lifecycle:lifecycle-test-impl' @@ -328,7 +330,6 @@ include 'libs:permissions:permission-datamodel' include 'libs:permissions:permission-validation' include 'libs:permissions:permission-validation-impl' include 'libs:permissions:permission-password' -include 'libs:ledger-lib-persistence' include 'libs:sandbox' include 'libs:sandbox-hooks' include 'libs:sandbox-internal' diff --git a/testing/ledger/ledger-utxo-base-test/build.gradle b/testing/ledger/ledger-utxo-base-test/build.gradle index 38c40b4cd01..40b8d07933f 100644 --- a/testing/ledger/ledger-utxo-base-test/build.gradle +++ b/testing/ledger/ledger-utxo-base-test/build.gradle @@ -12,6 +12,7 @@ dependencies { implementation project(':libs:ledger:ledger-utxo-transaction-verifier') implementation project(':components:ledger:ledger-utxo-flow') + implementation project(':libs:ledger-lib-utxo-flow') implementation project(':libs:membership:membership-common') implementation project(':libs:flows:flow-api') implementation libs.mockito.kotlin diff --git a/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt b/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt index dd9f158b354..78b23f8f33a 100644 --- a/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt +++ b/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt @@ -8,20 +8,20 @@ import net.corda.ledger.common.data.transaction.filtered.factory.impl.FilteredTr import net.corda.ledger.common.test.CommonLedgerTest import net.corda.ledger.common.testkit.anotherPublicKeyExample import net.corda.ledger.common.testkit.publicKeyExample +import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoLedgerTransactionFactoryImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoSignedTransactionFactoryImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.flow.impl.UtxoLedgerServiceImpl -import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryService -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerStateQueryService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl -import net.corda.ledger.utxo.flow.impl.transaction.factory.impl.UtxoLedgerTransactionFactoryImpl -import net.corda.ledger.utxo.flow.impl.transaction.factory.impl.UtxoSignedTransactionFactoryImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl import net.corda.ledger.utxo.flow.impl.transaction.filtered.factory.UtxoFilteredTransactionFactoryImpl import net.corda.ledger.utxo.flow.impl.transaction.serializer.amqp.UtxoSignedTransactionSerializer import net.corda.ledger.utxo.flow.impl.transaction.serializer.kryo.UtxoSignedTransactionKryoSerializer -import net.corda.ledger.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal -import net.corda.ledger.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.testkit.anotherNotaryX500Name import net.corda.ledger.utxo.testkit.getUtxoSignedTransactionExample import net.corda.ledger.utxo.testkit.notaryX500Name diff --git a/testing/ledger/ledger-utxo-testkit/build.gradle b/testing/ledger/ledger-utxo-testkit/build.gradle index 87be3897c3c..72d4ba32063 100644 --- a/testing/ledger/ledger-utxo-testkit/build.gradle +++ b/testing/ledger/ledger-utxo-testkit/build.gradle @@ -13,6 +13,7 @@ dependencies { implementation project(':components:ledger:ledger-utxo-flow') implementation project(':libs:crypto:cipher-suite') implementation project(':libs:ledger:ledger-common-data') + implementation project(':libs:ledger-lib-utxo-flow') implementation project(':libs:ledger:ledger-utxo-data') implementation project(':libs:serialization:json-validator') implementation project(':libs:serialization:json-validator-lib') diff --git a/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoLedgerIntegrationTest.kt b/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoLedgerIntegrationTest.kt index 772bd5643a8..532ba157c83 100644 --- a/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoLedgerIntegrationTest.kt +++ b/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoLedgerIntegrationTest.kt @@ -1,12 +1,12 @@ package net.corda.ledger.utxo.testkit import net.corda.ledger.common.integration.test.CommonLedgerIntegrationTest +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionImpl import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal import net.corda.ledger.utxo.data.transaction.WrappedUtxoWireTransaction import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory import net.corda.sandboxgroupcontext.getSandboxSingletonService import net.corda.testing.sandboxes.SandboxSetup import net.corda.v5.ledger.utxo.UtxoLedgerService @@ -38,4 +38,4 @@ abstract class UtxoLedgerIntegrationTest : CommonLedgerIntegrationTest() { null ) } -} \ No newline at end of file +} diff --git a/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoSignedTransactionExample.kt b/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoSignedTransactionExample.kt index a8e4a94dec4..892b13e13dd 100644 --- a/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoSignedTransactionExample.kt +++ b/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoSignedTransactionExample.kt @@ -8,13 +8,13 @@ import net.corda.ledger.common.testkit.createExample import net.corda.ledger.common.testkit.defaultComponentGroups import net.corda.ledger.common.testkit.getSignatureWithMetadataExample import net.corda.ledger.common.testkit.getWireTransactionExample +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.ledger.utxo.data.transaction.UtxoComponentGroup import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionImpl -import net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionInternal -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory -import net.corda.ledger.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.v5.application.crypto.DigestService import net.corda.v5.application.marshalling.JsonMarshallingService import net.corda.v5.application.serialization.SerializationService @@ -65,4 +65,4 @@ fun getUtxoSignedTransactionExample( wireTransaction, setOf(getSignatureWithMetadataExample()) ) -} \ No newline at end of file +} diff --git a/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoTimeWindowExample.kt b/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoTimeWindowExample.kt index 20e58a8e9ad..bd09f60376e 100644 --- a/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoTimeWindowExample.kt +++ b/testing/ledger/ledger-utxo-testkit/src/main/kotlin/net/corda/ledger/utxo/testkit/UtxoTimeWindowExample.kt @@ -1,6 +1,6 @@ package net.corda.ledger.utxo.testkit -import net.corda.ledger.utxo.flow.impl.timewindow.TimeWindowBetweenImpl import java.time.Instant +import net.corda.ledger.lib.utxo.flow.impl.timewindow.TimeWindowBetweenImpl -val utxoTimeWindowExample = TimeWindowBetweenImpl(Instant.MIN, Instant.MAX) \ No newline at end of file +val utxoTimeWindowExample = TimeWindowBetweenImpl(Instant.MIN, Instant.MAX) From 03a696b79c9e4aee8fb9d0fb329649c2f429dd2c Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Tue, 1 Oct 2024 10:24:51 +0100 Subject: [PATCH 02/10] Remove assert on fully qualified class name. --- .../tests/UtxoSignedTransactionAMQPSerializationTest.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedTransactionAMQPSerializationTest.kt b/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedTransactionAMQPSerializationTest.kt index 9860e2e9722..819b97d5d1b 100644 --- a/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedTransactionAMQPSerializationTest.kt +++ b/components/ledger/ledger-utxo-flow/src/integrationTest/kotlin/net/corda/ledger/utxo/flow/impl/transaction/serializer/tests/UtxoSignedTransactionAMQPSerializationTest.kt @@ -17,9 +17,6 @@ class UtxoSignedTransactionAMQPSerializationTest : UtxoLedgerIntegrationTest() { val deserialized = serializationService.deserialize(serialised) - assertThat(deserialized.javaClass.name) - .isEqualTo("net.corda.ledger.utxo.flow.impl.transaction.UtxoSignedTransactionImpl") - assertThat(deserialized) .isInstanceOf(UtxoSignedTransaction::class.java) .isEqualTo(utxoSignedTransaction) From 3adfc0e5bad63ae531bdb748ec55fa7602d903c1 Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Tue, 1 Oct 2024 14:23:29 +0100 Subject: [PATCH 03/10] Move SingletonSerializeAsToken into the OSGi class --- .../factory/impl/UtxoLedgerTransactionFactoryImpl.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt index 6766f39ee18..82d1aa289e3 100644 --- a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt @@ -11,21 +11,19 @@ import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionImpl import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal import net.corda.ledger.utxo.data.transaction.UtxoVisibleTransactionOutputDto import net.corda.ledger.utxo.data.transaction.WrappedUtxoWireTransaction -import net.corda.sandbox.type.UsedByFlow import net.corda.v5.application.serialization.SerializationService import net.corda.v5.base.annotations.Suspendable import net.corda.v5.base.exceptions.CordaRuntimeException import net.corda.v5.ledger.utxo.ContractState import net.corda.v5.ledger.utxo.StateAndRef import net.corda.v5.membership.GroupParameters -import net.corda.v5.serialization.SingletonSerializeAsToken class UtxoLedgerTransactionFactoryImpl( private val serializationService: SerializationService, private val utxoLedgerStateQueryService: UtxoLedgerStateQueryService, private val utxoLedgerGroupParametersPersistenceService: UtxoLedgerGroupParametersPersistenceService, private val groupParametersLookup: GroupParametersLookupInternal -) : UtxoLedgerTransactionFactory, UsedByFlow, SingletonSerializeAsToken { +) : UtxoLedgerTransactionFactory { @Suspendable override fun create( From 0f6c980ccee1cc4ce498fb70c75b4332eb76f947 Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Tue, 1 Oct 2024 15:59:18 +0100 Subject: [PATCH 04/10] Remove the dependency on sandbox from ledger-lib-utxo-flow --- .../impl/UtxoSignedTransactionFactoryOsgiImpl.kt | 4 ++-- libs/ledger-lib-utxo-flow/build.gradle | 2 -- .../impl/UtxoSignedTransactionFactoryImpl.kt | 13 +++++-------- .../net/corda/ledger/utxo/test/UtxoLedgerTest.kt | 4 ++-- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt index c6703ac1965..64f244ec658 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt @@ -64,7 +64,6 @@ class UtxoSignedTransactionFactoryOsgiImpl( privacySaltProviderService: PrivacySaltProviderService ) : this( UtxoSignedTransactionFactoryImpl( - currentSandboxGroupContext, jsonMarshallingService, jsonValidator, serializationService, @@ -77,7 +76,8 @@ class UtxoSignedTransactionFactoryOsgiImpl( groupParametersLookup, signedGroupParametersVerifier, notarySignatureVerificationService, - privacySaltProviderService + privacySaltProviderService, + getEvolvableTag = { tag -> currentSandboxGroupContext.get().sandboxGroup.getEvolvableTag(tag) } ) ) } diff --git a/libs/ledger-lib-utxo-flow/build.gradle b/libs/ledger-lib-utxo-flow/build.gradle index 9c400c11cd1..2178349ca94 100644 --- a/libs/ledger-lib-utxo-flow/build.gradle +++ b/libs/ledger-lib-utxo-flow/build.gradle @@ -27,8 +27,6 @@ dependencies { //This will be removed in a future commit implementation project(':libs:serialization:json-validator') implementation project(':libs:serialization:json-validator-lib') - //This will be removed in a future commit - implementation project(':libs:virtual-node:sandbox-group-context') implementation 'net.corda:corda-ledger-utxo' implementation 'net.corda:corda-base' diff --git a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt index 630555a7ed5..bd9370a616c 100644 --- a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt @@ -24,7 +24,6 @@ import net.corda.ledger.utxo.data.transaction.utxoComponentGroupStructure import net.corda.ledger.utxo.data.transaction.verifier.verifyMetadata import net.corda.libs.json.validator.JsonValidator import net.corda.membership.lib.SignedGroupParameters -import net.corda.sandboxgroupcontext.CurrentSandboxGroupContext import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.application.marshalling.JsonMarshallingService import net.corda.v5.application.serialization.SerializationService @@ -36,7 +35,6 @@ import java.security.PublicKey @Suppress("LongParameterList") class UtxoSignedTransactionFactoryImpl( - private val currentSandboxGroupContext: CurrentSandboxGroupContext, private val jsonMarshallingService: JsonMarshallingService, private val jsonValidator: JsonValidator, private val serializationService: SerializationService, @@ -49,7 +47,8 @@ class UtxoSignedTransactionFactoryImpl( private val groupParametersLookup: GroupParametersLookupInternal, private val signedGroupParametersVerifier: SignedGroupParametersVerifier, private val notarySignatureVerificationService: NotarySignatureVerificationServiceInternal, - private val privacySaltProviderService: PrivacySaltProviderService + private val privacySaltProviderService: PrivacySaltProviderService, + private val getEvolvableTag: (klass: Class<*>) -> String ) : UtxoSignedTransactionFactory { @Suspendable @@ -123,8 +122,6 @@ class UtxoSignedTransactionFactoryImpl( utxoTransactionBuilder: UtxoTransactionBuilderInternal, metadataBytes: ByteArray ): List> { - val currentSandboxGroup = currentSandboxGroupContext.get().sandboxGroup - val notaryGroup = listOf( utxoTransactionBuilder.notaryName, utxoTransactionBuilder.notaryKey, @@ -149,13 +146,13 @@ class UtxoSignedTransactionFactoryImpl( it.encumbranceGroup?.size, utxoTransactionBuilder.notaryName!!, utxoTransactionBuilder.notaryKey!!, - currentSandboxGroup.getEvolvableTag(it.contractStateType), - currentSandboxGroup.getEvolvableTag(it.contractType) + getEvolvableTag(it.contractStateType), + getEvolvableTag(it.contractType) ) } val commandsInfo = utxoTransactionBuilder.commands.map { - listOf(currentSandboxGroup.getEvolvableTag(it.javaClass)) + listOf(getEvolvableTag(it.javaClass)) } return UtxoComponentGroup.values().sorted().map { componentGroupIndex -> diff --git a/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt b/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt index 78b23f8f33a..301dcc59e4b 100644 --- a/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt +++ b/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt @@ -12,13 +12,13 @@ import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParameters import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoLedgerTransactionFactoryImpl -import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoSignedTransactionFactoryImpl import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.flow.impl.UtxoLedgerServiceImpl import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl +import net.corda.ledger.utxo.flow.impl.transaction.factory.impl.UtxoSignedTransactionFactoryOsgiImpl import net.corda.ledger.utxo.flow.impl.transaction.filtered.factory.UtxoFilteredTransactionFactoryImpl import net.corda.ledger.utxo.flow.impl.transaction.serializer.amqp.UtxoSignedTransactionSerializer import net.corda.ledger.utxo.flow.impl.transaction.serializer.kryo.UtxoSignedTransactionKryoSerializer @@ -77,7 +77,7 @@ abstract class UtxoLedgerTest : CommonLedgerTest() { mockUtxoLedgerGroupParametersPersistenceService, mockGroupParametersLookup ) - val utxoSignedTransactionFactory = UtxoSignedTransactionFactoryImpl( + val utxoSignedTransactionFactory = UtxoSignedTransactionFactoryOsgiImpl( currentSandboxGroupContext, jsonMarshallingService, jsonValidator, From 81760d93131694c3fa38f1759f1f86a2167fd46f Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Wed, 2 Oct 2024 09:28:08 +0100 Subject: [PATCH 05/10] Remove the group parameters from ledger-lib-utxo-flow --- .../v1/TransactionBackchainReceiverFlowV1.kt | 4 +-- .../v1/TransactionBackchainSenderFlowV1.kt | 2 +- .../finality/v1/UtxoReceiveFinalityFlowV1.kt | 4 +-- .../SignedGroupParametersVerifier.kt | 2 +- .../SignedGroupParametersVerifierImpl.kt | 1 - ...LedgerGroupParametersPersistenceService.kt | 2 +- ...erGroupParametersPersistenceServiceImpl.kt | 1 - .../UtxoLedgerTransactionFactoryOsgiImpl.kt | 26 +++++++++++++++--- .../UtxoSignedTransactionFactoryOsgiImpl.kt | 18 ++++++++----- ...edgerTransactionVerificationServiceImpl.kt | 2 +- .../TransactionBackchainReceiverFlowV1Test.kt | 4 +-- .../v1/UtxoReceiveFinalityFlowV1Test.kt | 4 +-- ...rTransactionVerificationServiceImplTest.kt | 2 +- libs/ledger-lib-utxo-flow/build.gradle | 4 --- .../impl/groupparameters/package-info.java | 4 --- .../impl/UtxoLedgerTransactionFactoryImpl.kt | 27 +------------------ .../impl/UtxoSignedTransactionFactoryImpl.kt | 23 +++------------- .../corda/ledger/utxo/test/UtxoLedgerTest.kt | 8 +++--- 18 files changed, 56 insertions(+), 82 deletions(-) rename {libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/groupparameters => components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier}/SignedGroupParametersVerifier.kt (90%) rename {libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib => components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger}/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt (95%) delete mode 100644 libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/groupparameters/package-info.java diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1.kt index 06b15e67f1a..eb44dbcc57f 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1.kt @@ -8,13 +8,13 @@ import net.corda.ledger.common.data.transaction.TransactionStatus.DRAFT import net.corda.ledger.common.data.transaction.TransactionStatus.INVALID import net.corda.ledger.common.data.transaction.TransactionStatus.UNVERIFIED import net.corda.ledger.common.data.transaction.TransactionStatus.VERIFIED -import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.UtxoLedgerMetricRecorder import net.corda.ledger.utxo.flow.impl.flows.backchain.InvalidBackchainException import net.corda.ledger.utxo.flow.impl.flows.backchain.TopologicalSort import net.corda.ledger.utxo.flow.impl.flows.backchain.dependencies +import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier import net.corda.ledger.utxo.flow.impl.persistence.TransactionExistenceStatus +import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService import net.corda.membership.lib.SignedGroupParameters import net.corda.sandbox.CordaSystemFlow diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainSenderFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainSenderFlowV1.kt index 76f008a56b0..0a1868e5605 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainSenderFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainSenderFlowV1.kt @@ -1,6 +1,6 @@ package net.corda.ledger.utxo.flow.impl.flows.backchain.v1 -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService import net.corda.sandbox.CordaSystemFlow import net.corda.utilities.trace diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1.kt index 949eb1b10f9..93126f8fcb4 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1.kt @@ -4,8 +4,6 @@ import net.corda.flow.application.GroupParametersLookupInternal import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.flow.flows.Payload -import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.ledger.utxo.data.transaction.verifyFilteredTransactionAndSignatures @@ -16,6 +14,8 @@ import net.corda.ledger.utxo.flow.impl.flows.finality.FinalityPayload import net.corda.ledger.utxo.flow.impl.flows.finality.addTransactionIdToFlowContext import net.corda.ledger.utxo.flow.impl.flows.finality.getVisibleStateIndexes import net.corda.ledger.utxo.flow.impl.flows.finality.v1.FinalityNotarizationFailureType.Companion.toFinalityNotarizationFailureType +import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier +import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.membership.lib.SignedGroupParameters import net.corda.sandbox.CordaSystemFlow import net.corda.utilities.trace diff --git a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/groupparameters/SignedGroupParametersVerifier.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifier.kt similarity index 90% rename from libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/groupparameters/SignedGroupParametersVerifier.kt rename to components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifier.kt index ea0744ff6cb..15a3893aba5 100644 --- a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/groupparameters/SignedGroupParametersVerifier.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifier.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.lib.utxo.flow.impl.groupparameters +package net.corda.ledger.utxo.flow.impl.groupparameters.verifier import net.corda.membership.lib.SignedGroupParameters import net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifierImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifierImpl.kt index b876cc8881e..092f813935e 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifierImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/groupparameters/verifier/SignedGroupParametersVerifierImpl.kt @@ -3,7 +3,6 @@ package net.corda.ledger.utxo.flow.impl.groupparameters.verifier import net.corda.crypto.cipher.suite.SignatureVerificationService import net.corda.flow.application.GroupParametersLookupInternal import net.corda.ledger.common.data.transaction.TransactionMetadataInternal -import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier import net.corda.membership.lib.SignedGroupParameters import net.corda.sandbox.type.SandboxConstants.CORDA_SYSTEM_SERVICE import net.corda.sandbox.type.UsedByFlow diff --git a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt similarity index 95% rename from libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt rename to components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt index f4b49999c72..453b079e92a 100644 --- a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceService.kt @@ -1,4 +1,4 @@ -package net.corda.ledger.lib.utxo.flow.impl.persistence +package net.corda.ledger.utxo.flow.impl.persistence import net.corda.membership.lib.SignedGroupParameters import net.corda.v5.application.persistence.CordaPersistenceException diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceServiceImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceServiceImpl.kt index 402dd55e18a..ff86f1d6271 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceServiceImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/persistence/UtxoLedgerGroupParametersPersistenceServiceImpl.kt @@ -3,7 +3,6 @@ package net.corda.ledger.utxo.flow.impl.persistence import io.micrometer.core.instrument.Timer import net.corda.flow.external.events.executor.ExternalEventExecutor import net.corda.flow.fiber.metrics.recordSuspendable -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.LedgerPersistenceMetricOperationName.FindGroupParameters import net.corda.ledger.utxo.flow.impl.persistence.LedgerPersistenceMetricOperationName.PersistSignedGroupParametersIfDoNotExist import net.corda.ledger.utxo.flow.impl.persistence.external.events.FindSignedGroupParametersExternalEventFactory diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryOsgiImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryOsgiImpl.kt index 2e91187230c..2d56c33b97c 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryOsgiImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryOsgiImpl.kt @@ -1,10 +1,12 @@ package net.corda.ledger.utxo.flow.impl.transaction.factory.impl +import net.corda.crypto.core.parseSecureHash import net.corda.flow.application.GroupParametersLookupInternal -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoLedgerTransactionFactoryImpl +import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.sandbox.type.SandboxConstants.CORDA_SYSTEM_SERVICE import net.corda.sandbox.type.UsedByFlow import net.corda.v5.application.serialization.SerializationService @@ -38,8 +40,24 @@ class UtxoLedgerTransactionFactoryOsgiImpl( UtxoLedgerTransactionFactoryImpl( serializationService, utxoLedgerStateQueryService, - utxoLedgerGroupParametersPersistenceService, - groupParametersLookup - ) + ) { wireTransaction -> + val membershipGroupParametersHashString = + requireNotNull((wireTransaction.metadata as TransactionMetadataInternal).getMembershipGroupParametersHash()) { + "Membership group parameters hash cannot be found in the transaction metadata." + } + val currentGroupParameters = groupParametersLookup.currentGroupParameters + val groupParameters = + if (currentGroupParameters.hash.toString() == membershipGroupParametersHashString) { + currentGroupParameters + } else { + val membershipGroupParametersHash = parseSecureHash(membershipGroupParametersHashString) + utxoLedgerGroupParametersPersistenceService.find(membershipGroupParametersHash) + } + requireNotNull(groupParameters) { + "Signed group parameters $membershipGroupParametersHashString related to the transaction " + + "${wireTransaction.id} cannot be accessed." + } + groupParameters + } ) } diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt index 64f244ec658..db28123cd6b 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt @@ -1,17 +1,18 @@ package net.corda.ledger.utxo.flow.impl.transaction.factory.impl import net.corda.flow.application.GroupParametersLookupInternal +import net.corda.ledger.common.data.transaction.TransactionMetadataImpl import net.corda.ledger.common.data.transaction.factory.WireTransactionFactory import net.corda.ledger.common.flow.transaction.PrivacySaltProviderService import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal import net.corda.ledger.common.flow.transaction.factory.TransactionMetadataFactory -import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoSignedTransactionFactory import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoSignedTransactionFactoryImpl import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService +import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier +import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.libs.json.validator.JsonValidator import net.corda.sandbox.type.UsedByFlow import net.corda.sandboxgroupcontext.CurrentSandboxGroupContext @@ -72,12 +73,17 @@ class UtxoSignedTransactionFactoryOsgiImpl( wireTransactionFactory, utxoLedgerTransactionFactory, utxoLedgerTransactionVerificationService, - utxoLedgerGroupParametersPersistenceService, - groupParametersLookup, - signedGroupParametersVerifier, notarySignatureVerificationService, privacySaltProviderService, - getEvolvableTag = { tag -> currentSandboxGroupContext.get().sandboxGroup.getEvolvableTag(tag) } + getEvolvableTag = { tag -> currentSandboxGroupContext.get().sandboxGroup.getEvolvableTag(tag) }, + getExtraMetadata = { + val signedGroupParameters = groupParametersLookup.currentGroupParameters + signedGroupParametersVerifier.verifySignature(signedGroupParameters) + utxoLedgerGroupParametersPersistenceService.persistIfDoesNotExist(signedGroupParameters) + return@UtxoSignedTransactionFactoryImpl mapOf( + TransactionMetadataImpl.MEMBERSHIP_GROUP_PARAMETERS_HASH_KEY to signedGroupParameters.hash.toString() + ) + } ) ) } diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImpl.kt index a3bf8b60df0..1cfeac40231 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImpl.kt @@ -4,11 +4,11 @@ import io.micrometer.core.instrument.Timer import net.corda.flow.external.events.executor.ExternalEventExecutor import net.corda.flow.fiber.metrics.recordSuspendable import net.corda.ledger.common.data.transaction.TransactionMetadataInternal -import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.data.transaction.TransactionVerificationStatus import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionContainer import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal +import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier import net.corda.membership.lib.SignedGroupParameters import net.corda.metrics.CordaMetrics import net.corda.sandbox.type.SandboxConstants.CORDA_SYSTEM_SERVICE diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1Test.kt index 529c409a4db..8f505413aa1 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/backchain/v1/TransactionBackchainReceiverFlowV1Test.kt @@ -6,13 +6,13 @@ import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.common.data.transaction.TransactionStatus.INVALID import net.corda.ledger.common.data.transaction.TransactionStatus.UNVERIFIED import net.corda.ledger.common.data.transaction.TransactionStatus.VERIFIED -import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedLedgerTransaction import net.corda.ledger.utxo.flow.impl.UtxoLedgerMetricRecorder import net.corda.ledger.utxo.flow.impl.flows.backchain.InvalidBackchainException import net.corda.ledger.utxo.flow.impl.flows.backchain.TopologicalSort +import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier import net.corda.ledger.utxo.flow.impl.persistence.TransactionExistenceStatus +import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService import net.corda.libs.configuration.SmartConfig import net.corda.membership.lib.SignedGroupParameters diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1Test.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1Test.kt index 159fff3f387..acb4d31639f 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1Test.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/flows/finality/v1/UtxoReceiveFinalityFlowV1Test.kt @@ -12,8 +12,6 @@ import net.corda.ledger.common.data.transaction.TransactionStatus import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.flow.flows.Payload import net.corda.ledger.common.testkit.publicKeyExample -import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService @@ -26,6 +24,8 @@ import net.corda.ledger.utxo.data.transaction.verifyFilteredTransactionAndSignat import net.corda.ledger.utxo.flow.impl.flows.backchain.TransactionBackchainResolutionFlow import net.corda.ledger.utxo.flow.impl.flows.backchain.dependencies import net.corda.ledger.utxo.flow.impl.flows.finality.FinalityPayload +import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier +import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.external.events.FindUnconsumedStatesByTypeExternalEventFactoryTest.TestContractState import net.corda.ledger.utxo.flow.impl.transaction.verifier.TransactionVerificationException diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImplTest.kt index f9e47233708..0aba19b677c 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/UtxoLedgerTransactionVerificationServiceImplTest.kt @@ -6,10 +6,10 @@ import net.corda.internal.serialization.SerializedBytesImpl import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.testkit.publicKeyExample -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.data.transaction.TransactionVerificationResult import net.corda.ledger.utxo.data.transaction.TransactionVerificationStatus import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionInternal +import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.utxo.flow.impl.persistence.external.events.ALICE_X500_HOLDING_IDENTITY import net.corda.ledger.utxo.testkit.notaryX500Name import net.corda.membership.lib.SignedGroupParameters diff --git a/libs/ledger-lib-utxo-flow/build.gradle b/libs/ledger-lib-utxo-flow/build.gradle index 2178349ca94..4d31c9ce1ba 100644 --- a/libs/ledger-lib-utxo-flow/build.gradle +++ b/libs/ledger-lib-utxo-flow/build.gradle @@ -20,10 +20,6 @@ dependencies { implementation project(':components:ledger:ledger-common-flow-api') implementation project(':components:ledger:ledger-common-flow') - //This will be removed in a future commit - implementation project(':libs:membership:membership-common') - //This will be removed in a future commit - implementation project(':libs:flows:flow-api') //This will be removed in a future commit implementation project(':libs:serialization:json-validator') implementation project(':libs:serialization:json-validator-lib') diff --git a/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/groupparameters/package-info.java b/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/groupparameters/package-info.java deleted file mode 100644 index 7712e0a2de9..00000000000 --- a/libs/ledger-lib-utxo-flow/src/main/java/net/corda/ledger/lib/utxo/flow/impl/groupparameters/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@Export -package net.corda.ledger.lib.utxo.flow.impl.groupparameters; - -import org.osgi.annotation.bundle.Export; diff --git a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt index 82d1aa289e3..5b9e5aa1f0e 100644 --- a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoLedgerTransactionFactoryImpl.kt @@ -1,10 +1,6 @@ package net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl -import net.corda.crypto.core.parseSecureHash -import net.corda.flow.application.GroupParametersLookupInternal -import net.corda.ledger.common.data.transaction.TransactionMetadataInternal import net.corda.ledger.common.data.transaction.WireTransaction -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory import net.corda.ledger.utxo.data.transaction.UtxoLedgerTransactionImpl @@ -21,8 +17,7 @@ import net.corda.v5.membership.GroupParameters class UtxoLedgerTransactionFactoryImpl( private val serializationService: SerializationService, private val utxoLedgerStateQueryService: UtxoLedgerStateQueryService, - private val utxoLedgerGroupParametersPersistenceService: UtxoLedgerGroupParametersPersistenceService, - private val groupParametersLookup: GroupParametersLookupInternal + private val getGroupParameters: (wireTransaction: WireTransaction) -> GroupParameters? ) : UtxoLedgerTransactionFactory { @Suspendable @@ -81,24 +76,4 @@ class UtxoLedgerTransactionFactoryImpl( getGroupParameters(wireTransaction) ) } - - private fun getGroupParameters(wireTransaction: WireTransaction): GroupParameters { - val membershipGroupParametersHashString = - requireNotNull((wireTransaction.metadata as TransactionMetadataInternal).getMembershipGroupParametersHash()) { - "Membership group parameters hash cannot be found in the transaction metadata." - } - val currentGroupParameters = groupParametersLookup.currentGroupParameters - val groupParameters = - if (currentGroupParameters.hash.toString() == membershipGroupParametersHashString) { - currentGroupParameters - } else { - val membershipGroupParametersHash = parseSecureHash(membershipGroupParametersHashString) - utxoLedgerGroupParametersPersistenceService.find(membershipGroupParametersHash) - } - requireNotNull(groupParameters) { - "Signed group parameters $membershipGroupParametersHashString related to the transaction " + - "${wireTransaction.id} cannot be accessed." - } - return groupParameters - } } diff --git a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt index bd9370a616c..2aac9da5da6 100644 --- a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryImpl.kt @@ -1,14 +1,11 @@ package net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl -import net.corda.flow.application.GroupParametersLookupInternal import net.corda.ledger.common.data.transaction.TransactionMetadataImpl import net.corda.ledger.common.data.transaction.WireTransaction import net.corda.ledger.common.data.transaction.factory.WireTransactionFactory import net.corda.ledger.common.flow.transaction.PrivacySaltProviderService import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal import net.corda.ledger.common.flow.transaction.factory.TransactionMetadataFactory -import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionImpl import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoSignedTransactionInternal import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderInternal @@ -23,7 +20,6 @@ import net.corda.ledger.utxo.data.transaction.UtxoTransactionMetadata import net.corda.ledger.utxo.data.transaction.utxoComponentGroupStructure import net.corda.ledger.utxo.data.transaction.verifier.verifyMetadata import net.corda.libs.json.validator.JsonValidator -import net.corda.membership.lib.SignedGroupParameters import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.application.marshalling.JsonMarshallingService import net.corda.v5.application.serialization.SerializationService @@ -43,12 +39,10 @@ class UtxoSignedTransactionFactoryImpl( private val wireTransactionFactory: WireTransactionFactory, private val utxoLedgerTransactionFactory: UtxoLedgerTransactionFactory, private val utxoLedgerTransactionVerificationService: UtxoLedgerTransactionVerificationService, - private val utxoLedgerGroupParametersPersistenceService: UtxoLedgerGroupParametersPersistenceService, - private val groupParametersLookup: GroupParametersLookupInternal, - private val signedGroupParametersVerifier: SignedGroupParametersVerifier, private val notarySignatureVerificationService: NotarySignatureVerificationServiceInternal, private val privacySaltProviderService: PrivacySaltProviderService, - private val getEvolvableTag: (klass: Class<*>) -> String + private val getEvolvableTag: (klass: Class<*>) -> String, + private val getExtraMetadata: () -> Map ) : UtxoSignedTransactionFactory { @Suspendable @@ -56,7 +50,7 @@ class UtxoSignedTransactionFactoryImpl( utxoTransactionBuilder: UtxoTransactionBuilderInternal, signatories: Iterable ): UtxoSignedTransactionInternal { - val utxoMetadata = utxoMetadata() + val utxoMetadata = utxoMetadata() + getExtraMetadata() val metadata = transactionMetadataFactory.create(utxoMetadata) verifyMetadata(metadata) @@ -97,22 +91,13 @@ class UtxoSignedTransactionFactoryImpl( ) @Suspendable - private fun utxoMetadata() = mapOf( + private fun utxoMetadata() = mapOf( TransactionMetadataImpl.LEDGER_MODEL_KEY to UtxoLedgerTransactionImpl::class.java.name, TransactionMetadataImpl.LEDGER_VERSION_KEY to UtxoTransactionMetadata.LEDGER_VERSION, TransactionMetadataImpl.TRANSACTION_SUBTYPE_KEY to UtxoTransactionMetadata.TransactionSubtype.GENERAL, TransactionMetadataImpl.COMPONENT_GROUPS_KEY to utxoComponentGroupStructure, - TransactionMetadataImpl.MEMBERSHIP_GROUP_PARAMETERS_HASH_KEY to getAndPersistCurrentMgmGroupParameters().hash.toString() ) - @Suspendable - private fun getAndPersistCurrentMgmGroupParameters(): SignedGroupParameters { - val signedGroupParameters = groupParametersLookup.currentGroupParameters - signedGroupParametersVerifier.verifySignature(signedGroupParameters) - utxoLedgerGroupParametersPersistenceService.persistIfDoesNotExist(signedGroupParameters) - return signedGroupParameters - } - private fun serializeMetadata(metadata: TransactionMetadata): ByteArray { return jsonValidator.canonicalize(jsonMarshallingService.format(metadata)).toByteArray() } diff --git a/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt b/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt index 301dcc59e4b..50f4179902a 100644 --- a/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt +++ b/testing/ledger/ledger-utxo-base-test/src/main/kotlin/net/corda/ledger/utxo/test/UtxoLedgerTest.kt @@ -8,16 +8,16 @@ import net.corda.ledger.common.data.transaction.filtered.factory.impl.FilteredTr import net.corda.ledger.common.test.CommonLedgerTest import net.corda.ledger.common.testkit.anotherPublicKeyExample import net.corda.ledger.common.testkit.publicKeyExample -import net.corda.ledger.lib.utxo.flow.impl.groupparameters.SignedGroupParametersVerifier -import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.utxo.flow.impl.groupparameters.verifier.SignedGroupParametersVerifier import net.corda.ledger.lib.utxo.flow.impl.persistence.UtxoLedgerStateQueryService -import net.corda.ledger.lib.utxo.flow.impl.transaction.factory.impl.UtxoLedgerTransactionFactoryImpl import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.UtxoLedgerTransactionVerificationService import net.corda.ledger.utxo.flow.impl.UtxoLedgerServiceImpl import net.corda.ledger.utxo.flow.impl.notary.PluggableNotaryService import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerPersistenceService import net.corda.ledger.lib.utxo.flow.impl.transaction.UtxoTransactionBuilderImpl +import net.corda.ledger.utxo.flow.impl.persistence.UtxoLedgerGroupParametersPersistenceService +import net.corda.ledger.utxo.flow.impl.transaction.factory.impl.UtxoLedgerTransactionFactoryOsgiImpl import net.corda.ledger.utxo.flow.impl.transaction.factory.impl.UtxoSignedTransactionFactoryOsgiImpl import net.corda.ledger.utxo.flow.impl.transaction.filtered.factory.UtxoFilteredTransactionFactoryImpl import net.corda.ledger.utxo.flow.impl.transaction.serializer.amqp.UtxoSignedTransactionSerializer @@ -71,7 +71,7 @@ abstract class UtxoLedgerTest : CommonLedgerTest() { mock() ), serializationServiceWithWireTx ) - private val utxoLedgerTransactionFactory = UtxoLedgerTransactionFactoryImpl( + private val utxoLedgerTransactionFactory = UtxoLedgerTransactionFactoryOsgiImpl( serializationServiceWithWireTx, mockUtxoLedgerStateQueryService, mockUtxoLedgerGroupParametersPersistenceService, From 005b8016733bc08fa1d13df750a56de646a9b310 Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Wed, 2 Oct 2024 10:29:01 +0100 Subject: [PATCH 06/10] Tidy build.gradle --- libs/ledger-lib-utxo-flow/build.gradle | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/ledger-lib-utxo-flow/build.gradle b/libs/ledger-lib-utxo-flow/build.gradle index 4d31c9ce1ba..cd435e61cc0 100644 --- a/libs/ledger-lib-utxo-flow/build.gradle +++ b/libs/ledger-lib-utxo-flow/build.gradle @@ -15,15 +15,13 @@ dependencies { implementation project(':libs:ledger:ledger-common-data') implementation project(':libs:ledger:ledger-utxo-data') implementation project(':libs:ledger:ledger-utxo-transaction-verifier') + implementation project(':libs:serialization:json-validator') + implementation project(':libs:serialization:json-validator-lib') //Should we rename components:ledger:ledger-common-flow-api to libs:ledger:ledger-common-flow-api etc. implementation project(':components:ledger:ledger-common-flow-api') implementation project(':components:ledger:ledger-common-flow') - //This will be removed in a future commit - implementation project(':libs:serialization:json-validator') - implementation project(':libs:serialization:json-validator-lib') - implementation 'net.corda:corda-ledger-utxo' implementation 'net.corda:corda-base' From 54c69ae63bfe93e4630a4eab8f927c5e282d2d22 Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Mon, 7 Oct 2024 15:27:06 +0100 Subject: [PATCH 07/10] Tidy code --- .../UtxoSignedTransactionFactoryOsgiImpl.kt | 5 +++-- .../transaction/UtxoTransactionBuilderImpl.kt | 21 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt index db28123cd6b..eefc441bc8f 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/factory/impl/UtxoSignedTransactionFactoryOsgiImpl.kt @@ -18,6 +18,7 @@ import net.corda.sandbox.type.UsedByFlow import net.corda.sandboxgroupcontext.CurrentSandboxGroupContext import net.corda.v5.application.marshalling.JsonMarshallingService import net.corda.v5.application.serialization.SerializationService +import net.corda.v5.base.annotations.Suspendable import net.corda.v5.serialization.SingletonSerializeAsToken import org.osgi.service.component.annotations.Activate import org.osgi.service.component.annotations.Component @@ -76,11 +77,11 @@ class UtxoSignedTransactionFactoryOsgiImpl( notarySignatureVerificationService, privacySaltProviderService, getEvolvableTag = { tag -> currentSandboxGroupContext.get().sandboxGroup.getEvolvableTag(tag) }, - getExtraMetadata = { + getExtraMetadata = @Suspendable { val signedGroupParameters = groupParametersLookup.currentGroupParameters signedGroupParametersVerifier.verifySignature(signedGroupParameters) utxoLedgerGroupParametersPersistenceService.persistIfDoesNotExist(signedGroupParameters) - return@UtxoSignedTransactionFactoryImpl mapOf( + mapOf( TransactionMetadataImpl.MEMBERSHIP_GROUP_PARAMETERS_HASH_KEY to signedGroupParameters.hash.toString() ) } diff --git a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt index 8e4ce4c9561..d1afbf44f64 100644 --- a/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/UtxoTransactionBuilderImpl.kt @@ -13,16 +13,19 @@ import net.corda.v5.ledger.utxo.StateRef import net.corda.v5.ledger.utxo.TimeWindow import net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction import net.corda.v5.ledger.utxo.transaction.UtxoTransactionBuilder +import java.security.PublicKey +import java.time.Instant +import java.util.Objects @Suppress("TooManyFunctions", "LongParameterList") class UtxoTransactionBuilderImpl( private val utxoSignedTransactionFactory: UtxoSignedTransactionFactory, private val notaryLookup: NotaryLookup, private var notaryName: MemberX500Name? = null, - private var notaryKey: java.security.PublicKey? = null, + private var notaryKey: PublicKey? = null, override var timeWindow: TimeWindow? = null, override val commands: MutableList = mutableListOf(), - override val signatories: MutableList = mutableListOf(), + override val signatories: MutableList = mutableListOf(), override val inputStateRefs: MutableList = mutableListOf(), override val referenceStateRefs: MutableList = mutableListOf(), override val outputStates: MutableList = mutableListOf() @@ -35,7 +38,7 @@ class UtxoTransactionBuilderImpl( return this } - override fun addSignatories(signatories: Iterable): UtxoTransactionBuilder { + override fun addSignatories(signatories: Iterable): UtxoTransactionBuilder { require( this.signatories.intersect(signatories.toSet()).isEmpty() && signatories.distinct().size == signatories.count() @@ -46,7 +49,7 @@ class UtxoTransactionBuilderImpl( return this } - override fun addSignatories(vararg signatories: java.security.PublicKey): UtxoTransactionBuilder { + override fun addSignatories(vararg signatories: PublicKey): UtxoTransactionBuilder { return addSignatories(signatories.toList()) } @@ -147,16 +150,16 @@ class UtxoTransactionBuilderImpl( return this } - override fun getNotaryKey(): java.security.PublicKey? { + override fun getNotaryKey(): PublicKey? { return notaryKey } - override fun setTimeWindowUntil(until: java.time.Instant): UtxoTransactionBuilder { + override fun setTimeWindowUntil(until: Instant): UtxoTransactionBuilder { this.timeWindow = TimeWindowUntilImpl(until) return this } - override fun setTimeWindowBetween(from: java.time.Instant, until: java.time.Instant): UtxoTransactionBuilder { + override fun setTimeWindowBetween(from: Instant, until: Instant): UtxoTransactionBuilder { this.timeWindow = TimeWindowBetweenImpl(from, until) return this } @@ -206,7 +209,7 @@ class UtxoTransactionBuilderImpl( other.signatories == signatories } - override fun hashCode(): Int = java.util.Objects.hash( + override fun hashCode(): Int = Objects.hash( notaryName, notaryKey, timeWindow, @@ -254,7 +257,7 @@ class UtxoTransactionBuilderImpl( ) } - private fun lookUpNotaryKey(notaryName: MemberX500Name?): java.security.PublicKey? { + private fun lookUpNotaryKey(notaryName: MemberX500Name?): PublicKey? { if (notaryName == null) { return null } From 5d8f15489fcfbcb9687f78b9af23a361e13fe7de Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Wed, 9 Oct 2024 11:08:13 +0100 Subject: [PATCH 08/10] Split out NotarySignatureVerificationService --- ...arySignatureVerificationServiceOsgiImpl.kt | 38 +++++++++++++++++++ ...gnatureVerificationServiceOsgiImplTest.kt} | 6 +-- .../NotarySignatureVerificationServiceImpl.kt | 28 ++------------ 3 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceOsgiImpl.kt rename components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/{NotarySignatureVerificationServiceImplTest.kt => NotarySignatureVerificationServiceOsgiImplTest.kt} (98%) rename {components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger => libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib}/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt (73%) diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceOsgiImpl.kt b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceOsgiImpl.kt new file mode 100644 index 00000000000..35646c9b40e --- /dev/null +++ b/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceOsgiImpl.kt @@ -0,0 +1,38 @@ +package net.corda.ledger.utxo.flow.impl.transaction.verifier + +import net.corda.ledger.common.flow.transaction.TransactionSignatureVerificationServiceInternal +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceImpl +import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal +import net.corda.sandbox.type.UsedByFlow +import net.corda.sandbox.type.UsedByVerification +import net.corda.v5.ledger.utxo.NotarySignatureVerificationService +import net.corda.v5.serialization.SingletonSerializeAsToken +import org.osgi.service.component.annotations.Activate +import org.osgi.service.component.annotations.Component +import org.osgi.service.component.annotations.Reference +import org.osgi.service.component.annotations.ServiceScope.PROTOTYPE + +@Component( + service = [ + NotarySignatureVerificationService::class, + NotarySignatureVerificationServiceInternal::class, + UsedByFlow::class, + UsedByVerification::class + ], + scope = PROTOTYPE +) +class NotarySignatureVerificationServiceOsgiImpl( + delegate: NotarySignatureVerificationServiceImpl, +) : NotarySignatureVerificationService, + NotarySignatureVerificationServiceInternal by delegate, + UsedByFlow, + UsedByVerification, + SingletonSerializeAsToken { + + @Suppress("Unused") + @Activate + constructor( + @Reference(service = TransactionSignatureVerificationServiceInternal::class) + transactionSignatureService: TransactionSignatureVerificationServiceInternal + ) : this(NotarySignatureVerificationServiceImpl(transactionSignatureService)) +} diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImplTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceOsgiImplTest.kt similarity index 98% rename from components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImplTest.kt rename to components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceOsgiImplTest.kt index a2dd65738bb..7c69322ee66 100644 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImplTest.kt +++ b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceOsgiImplTest.kt @@ -23,8 +23,8 @@ import java.security.PublicKey import java.time.Instant import kotlin.test.assertEquals -class NotarySignatureVerificationServiceImplTest { - private lateinit var notarySignatureVerificationService: NotarySignatureVerificationServiceImpl +class NotarySignatureVerificationServiceOsgiImplTest { + private lateinit var notarySignatureVerificationService: NotarySignatureVerificationServiceOsgiImpl private val transactionSignatureServiceInternal = mock() // notarykeys @@ -60,7 +60,7 @@ class NotarySignatureVerificationServiceImplTest { @BeforeEach fun setup() { - notarySignatureVerificationService = NotarySignatureVerificationServiceImpl( + notarySignatureVerificationService = NotarySignatureVerificationServiceOsgiImpl( transactionSignatureServiceInternal ) } diff --git a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt similarity index 73% rename from components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt rename to libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt index 596bee4f85e..92ca68cb9c0 100644 --- a/components/ledger/ledger-utxo-flow/src/main/kotlin/net/corda/ledger/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt +++ b/libs/ledger-lib-utxo-flow/src/main/kotlin/net/corda/ledger/lib/utxo/flow/impl/transaction/verifier/NotarySignatureVerificationServiceImpl.kt @@ -1,9 +1,6 @@ -package net.corda.ledger.utxo.flow.impl.transaction.verifier +package net.corda.ledger.lib.utxo.flow.impl.transaction.verifier import net.corda.ledger.common.flow.transaction.TransactionSignatureVerificationServiceInternal -import net.corda.ledger.lib.utxo.flow.impl.transaction.verifier.NotarySignatureVerificationServiceInternal -import net.corda.sandbox.type.UsedByFlow -import net.corda.sandbox.type.UsedByVerification import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.crypto.CompositeKey import net.corda.v5.crypto.KeyUtils @@ -11,30 +8,11 @@ import net.corda.v5.crypto.SecureHash import net.corda.v5.ledger.common.transaction.TransactionSignatureException import net.corda.v5.ledger.common.transaction.TransactionWithMetadata import net.corda.v5.ledger.utxo.NotarySignatureVerificationService -import net.corda.v5.serialization.SingletonSerializeAsToken -import org.osgi.service.component.annotations.Activate -import org.osgi.service.component.annotations.Component -import org.osgi.service.component.annotations.Reference -import org.osgi.service.component.annotations.ServiceScope.PROTOTYPE import java.security.PublicKey -@Component( - service = [ - NotarySignatureVerificationService::class, - NotarySignatureVerificationServiceInternal::class, - UsedByFlow::class, - UsedByVerification::class - ], - scope = PROTOTYPE -) -class NotarySignatureVerificationServiceImpl @Activate constructor( - @Reference(service = TransactionSignatureVerificationServiceInternal::class) +class NotarySignatureVerificationServiceImpl( private val transactionSignatureService: TransactionSignatureVerificationServiceInternal -) : NotarySignatureVerificationService, - NotarySignatureVerificationServiceInternal, - UsedByFlow, - UsedByVerification, - SingletonSerializeAsToken { +) : NotarySignatureVerificationService, NotarySignatureVerificationServiceInternal { override fun verifyNotarySignatures( transaction: TransactionWithMetadata, notaryKey: PublicKey, From d9f4465767dcfca1a5fb8f221a4c1fc282d19d86 Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Wed, 9 Oct 2024 17:29:00 +0100 Subject: [PATCH 09/10] Pull flow service out of TransactionSignatureService --- .../TransactionSignatureServiceImpl.kt | 30 ++-------- .../TransactionSignatureServiceOsgiImpl.kt | 57 +++++++++++++++++++ .../ledger/common/test/CommonLedgerTest.kt | 4 +- 3 files changed, 64 insertions(+), 27 deletions(-) create mode 100644 components/ledger/ledger-common-flow/src/main/kotlin/net/corda/ledger/common/flow/impl/transaction/TransactionSignatureServiceOsgiImpl.kt diff --git a/components/ledger/ledger-common-flow/src/main/kotlin/net/corda/ledger/common/flow/impl/transaction/TransactionSignatureServiceImpl.kt b/components/ledger/ledger-common-flow/src/main/kotlin/net/corda/ledger/common/flow/impl/transaction/TransactionSignatureServiceImpl.kt index d4384b16325..615de67b301 100644 --- a/components/ledger/ledger-common-flow/src/main/kotlin/net/corda/ledger/common/flow/impl/transaction/TransactionSignatureServiceImpl.kt +++ b/components/ledger/ledger-common-flow/src/main/kotlin/net/corda/ledger/common/flow/impl/transaction/TransactionSignatureServiceImpl.kt @@ -8,51 +8,31 @@ import net.corda.ledger.common.data.transaction.getBatchMerkleTreeDigestProvider import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal import net.corda.ledger.common.flow.transaction.TransactionSignatureVerificationServiceInternal import net.corda.libs.platform.PlatformInfoProvider -import net.corda.sandbox.type.UsedByFlow import net.corda.v5.application.crypto.DigitalSignatureAndMetadata import net.corda.v5.application.crypto.DigitalSignatureMetadata import net.corda.v5.application.crypto.SignatureSpecService import net.corda.v5.application.crypto.SigningService -import net.corda.v5.application.flows.FlowEngine import net.corda.v5.base.annotations.Suspendable import net.corda.v5.crypto.SignatureSpec +import net.corda.v5.ledger.common.transaction.CordaPackageSummary import net.corda.v5.ledger.common.transaction.TransactionNoAvailableKeysException import net.corda.v5.ledger.common.transaction.TransactionSignatureService import net.corda.v5.ledger.common.transaction.TransactionWithMetadata -import net.corda.v5.serialization.SingletonSerializeAsToken -import org.osgi.service.component.annotations.Activate -import org.osgi.service.component.annotations.Component -import org.osgi.service.component.annotations.Reference -import org.osgi.service.component.annotations.ServiceScope import java.security.PublicKey import java.time.Instant -@Suppress("Unused", "LongParameterList") -@Component( - service = [TransactionSignatureService::class, TransactionSignatureServiceInternal::class, UsedByFlow::class], - scope = ServiceScope.PROTOTYPE -) -class TransactionSignatureServiceImpl @Activate constructor( - @Reference(service = SerializationServiceInternal::class) +@Suppress("LongParameterList") +class TransactionSignatureServiceImpl( private val serializationService: SerializationServiceInternal, - @Reference(service = SigningService::class) private val signingService: SigningService, - @Reference(service = SignatureSpecService::class) private val signatureSpecService: SignatureSpecService, - @Reference(service = MerkleTreeProvider::class) private val merkleTreeProvider: MerkleTreeProvider, - @Reference(service = PlatformInfoProvider::class) private val platformInfoProvider: PlatformInfoProvider, - @Reference(service = FlowEngine::class) - private val flowEngine: FlowEngine, - @Reference(service = TransactionSignatureVerificationServiceInternal::class) + private val getCpiSummary: () -> CordaPackageSummary, private val transactionSignatureVerificationServiceInternal: TransactionSignatureVerificationServiceInternal ) : TransactionSignatureService, TransactionSignatureServiceInternal, - SingletonSerializeAsToken, - UsedByFlow, TransactionSignatureVerificationServiceInternal by transactionSignatureVerificationServiceInternal { - @Suspendable override fun sign( transaction: TransactionWithMetadata, @@ -124,7 +104,7 @@ class TransactionSignatureServiceImpl @Activate constructor( signatureSpec: SignatureSpec, batchSettings: Map = emptyMap() ): DigitalSignatureMetadata { - val cpiSummary = flowEngine.getCpiSummary() + val cpiSummary = getCpiSummary() return DigitalSignatureMetadata( Instant.now(), signatureSpec, diff --git a/components/ledger/ledger-common-flow/src/main/kotlin/net/corda/ledger/common/flow/impl/transaction/TransactionSignatureServiceOsgiImpl.kt b/components/ledger/ledger-common-flow/src/main/kotlin/net/corda/ledger/common/flow/impl/transaction/TransactionSignatureServiceOsgiImpl.kt new file mode 100644 index 00000000000..79299bac140 --- /dev/null +++ b/components/ledger/ledger-common-flow/src/main/kotlin/net/corda/ledger/common/flow/impl/transaction/TransactionSignatureServiceOsgiImpl.kt @@ -0,0 +1,57 @@ +package net.corda.ledger.common.flow.impl.transaction + +import net.corda.crypto.cipher.suite.merkle.MerkleTreeProvider +import net.corda.internal.serialization.amqp.api.SerializationServiceInternal +import net.corda.ledger.common.flow.transaction.TransactionSignatureServiceInternal +import net.corda.ledger.common.flow.transaction.TransactionSignatureVerificationServiceInternal +import net.corda.libs.platform.PlatformInfoProvider +import net.corda.sandbox.type.UsedByFlow +import net.corda.v5.application.crypto.SignatureSpecService +import net.corda.v5.application.crypto.SigningService +import net.corda.v5.application.flows.FlowEngine +import net.corda.v5.ledger.common.transaction.TransactionSignatureService +import net.corda.v5.serialization.SingletonSerializeAsToken +import org.osgi.service.component.annotations.Activate +import org.osgi.service.component.annotations.Component +import org.osgi.service.component.annotations.Reference +import org.osgi.service.component.annotations.ServiceScope + +@Suppress("Unused", "LongParameterList") +@Component( + service = [TransactionSignatureService::class, TransactionSignatureServiceInternal::class, UsedByFlow::class], + scope = ServiceScope.PROTOTYPE +) +class TransactionSignatureServiceOsgiImpl( + delegate: TransactionSignatureServiceImpl +) : TransactionSignatureService, + TransactionSignatureServiceInternal by delegate, + SingletonSerializeAsToken, + UsedByFlow { + @Activate + constructor( + @Reference(service = SerializationServiceInternal::class) + serializationService: SerializationServiceInternal, + @Reference(service = SigningService::class) + signingService: SigningService, + @Reference(service = SignatureSpecService::class) + signatureSpecService: SignatureSpecService, + @Reference(service = MerkleTreeProvider::class) + merkleTreeProvider: MerkleTreeProvider, + @Reference(service = PlatformInfoProvider::class) + platformInfoProvider: PlatformInfoProvider, + @Reference(service = FlowEngine::class) + flowEngine: FlowEngine, + @Reference(service = TransactionSignatureVerificationServiceInternal::class) + transactionSignatureVerificationServiceInternal: TransactionSignatureVerificationServiceInternal + ) : this( + TransactionSignatureServiceImpl( + serializationService, + signingService, + signatureSpecService, + merkleTreeProvider, + platformInfoProvider, + { flowEngine.getCpiSummary() }, + transactionSignatureVerificationServiceInternal + ) + ) +} diff --git a/testing/ledger/ledger-common-base-test/src/main/kotlin/net/corda/ledger/common/test/CommonLedgerTest.kt b/testing/ledger/ledger-common-base-test/src/main/kotlin/net/corda/ledger/common/test/CommonLedgerTest.kt index b025f73c2d1..dbbeead4cae 100644 --- a/testing/ledger/ledger-common-base-test/src/main/kotlin/net/corda/ledger/common/test/CommonLedgerTest.kt +++ b/testing/ledger/ledger-common-base-test/src/main/kotlin/net/corda/ledger/common/test/CommonLedgerTest.kt @@ -15,7 +15,7 @@ import net.corda.internal.serialization.amqp.helper.TestSerializationService import net.corda.ledger.common.data.transaction.PrivacySaltImpl import net.corda.ledger.common.data.transaction.factory.WireTransactionFactoryImpl import net.corda.ledger.common.data.transaction.serializer.amqp.WireTransactionSerializer -import net.corda.ledger.common.flow.impl.transaction.TransactionSignatureServiceImpl +import net.corda.ledger.common.flow.impl.transaction.TransactionSignatureServiceOsgiImpl import net.corda.ledger.common.flow.impl.transaction.TransactionSignatureVerificationServiceImpl import net.corda.ledger.common.flow.impl.transaction.factory.TransactionMetadataFactoryImpl import net.corda.ledger.common.flow.impl.transaction.serializer.kryo.WireTransactionKryoSerializer @@ -84,7 +84,7 @@ abstract class CommonLedgerTest { digestService, cipherSchemeMetadata ) - val transactionSignatureService = TransactionSignatureServiceImpl( + val transactionSignatureService = TransactionSignatureServiceOsgiImpl( serializationServiceWithWireTx, mockSigningService(), signatureSpecService, From ccaf79800a5ee23d5d9d0017205c53a3f85a2de6 Mon Sep 17 00:00:00 2001 From: Will Vigor Date: Fri, 11 Oct 2024 10:13:21 +0100 Subject: [PATCH 10/10] Use alpha corda-api version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 470c30b8f09..a4c4c8f6148 100644 --- a/gradle.properties +++ b/gradle.properties @@ -39,7 +39,7 @@ commonsLangVersion = 3.12.0 commonsTextVersion = 1.10.0 # Corda API libs revision (change in 4th digit indicates a breaking change) # Change to 5.3.0.xx-SNAPSHOT to pick up maven local published copy -cordaApiVersion=5.3.0.16-beta+ +cordaApiVersion=5.3.0.16-alpha-1728575408497 disruptorVersion=3.4.4 felixConfigAdminVersion=1.9.26