From f588698b90dbf9c8055524a637b7658095960a08 Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Sat, 16 Dec 2023 00:03:07 +0000 Subject: [PATCH 01/10] initial commit - adding the send and receive functions --- gradle.properties | 2 +- .../scans/corda-ledger-utxo-5.2.0.yaml | 27 +++++++++++++++++++ .../v5/ledger/utxo/UtxoLedgerService.java | 26 ++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6040cba2d1..6bef06c4c2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ cordaProductVersion = 5.2.0 # NOTE: update this each time this module contains a breaking change ## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to ## a per module property in which case module versions can change independently. -cordaApiRevision = 12 +cordaApiRevision=17 # Main kotlinVersion = 1.8.21 diff --git a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml index b8e6f03588..7bb6f33233 100644 --- a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml +++ b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml @@ -496,6 +496,18 @@ net.corda.v5.ledger.utxo.UtxoLedgerService: annotation: - NotNull type: net.corda.v5.application.messaging.FlowSession + receiveLedgerTransaction: + annotations: + - Suspendable + - NotNull + default: false + type: public abstract + returnType: net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction + params: + session: + annotation: + - NotNull + type: net.corda.v5.application.messaging.FlowSession sendTransaction: annotations: - Suspendable @@ -526,6 +538,21 @@ net.corda.v5.ledger.utxo.UtxoLedgerService: annotation: - NotNull type: net.corda.v5.application.messaging.FlowSession + sendWireTransaction: + annotations: + - Suspendable + default: false + type: public abstract + returnType: void + params: + signedTransaction: + annotation: + - NotNull + type: net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction + sessions: + annotation: + - NotNull + type: java.util.List net.corda.v5.ledger.utxo.VisibilityChecker: annotations: - DoNotImplement diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java index 890bcc1587..ff54786680 100644 --- a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java @@ -275,6 +275,32 @@ UtxoSignedTransaction receiveTransaction( @NotNull FlowSession session ); + /** + * Sends the wire transaction to counterparty sessions. + * + * @param sessions The counterparties who receive the transaction. + * @param signedTransaction The {@link UtxoSignedTransaction} to send. + * @throws CordaRuntimeException If transaction verification fails on the receiving sessions. + */ + @Suspendable + void sendWireTransaction( + @NotNull UtxoSignedTransaction signedTransaction, + @NotNull List sessions + ); + + /** + * Receives a verified transaction from the counterparty session and persists it to the vault. + * + * @param session The counterparty to receive a transaction from. + * @return the {@link UtxoLedgerTransaction} received from counterparty. + * @throws CordaRuntimeException If the transaction received fails verification. + */ + @NotNull + @Suspendable + UtxoLedgerTransaction receiveLedgerTransaction( + @NotNull FlowSession session + ); + /** * Creates a query object for a vault named query with the given name. This query can be executed later by calling * {@link PagedQuery#execute()}. From 48b7ea96e230ccc329f4cadf1cfea3f12a90978a Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Mon, 18 Dec 2023 10:25:06 +0000 Subject: [PATCH 02/10] updated yaml --- gradle.properties | 2 +- .../scans/corda-ledger-utxo-5.2.0.yaml | 48 +++++++++++++++---- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/gradle.properties b/gradle.properties index a3b10d0770..03b69684a8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ cordaProductVersion = 5.2.0 # NOTE: update this each time this module contains a breaking change ## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to ## a per module property in which case module versions can change independently. -cordaApiRevision = 17 +cordaApiRevision = 17-julia1 # Main kotlin.stdlib.default.dependency = false diff --git a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml index 4b85005f09..a6b2c4dbe3 100644 --- a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml +++ b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml @@ -593,24 +593,52 @@ net.corda.v5.ledger.utxo.UtxoLedgerService: annotation: - NotNull type: java.util.List -net.corda.v5.ledger.utxo.VisibilityChecker: - annotations: - - DoNotImplement +net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory: + annotations: [] type: public interface extends: [] interface: true methods: - containsMySigningKeys: + create: annotations: - Suspendable default: false - type: public abstract - returnType: boolean + type: public + returnType: UtxoLedgerTransactionInternal params: - keys: - annotation: - - NotNull - type: Iterable + wireTransaction: + annotation: [] + type: WireTransaction +# create: +# annotations: [] +# default: false +# type: public +# returnType: UtxoLedgerTransactionInternal +# params: +# wireTransaction: +# annotation: [] +# type: WireTransaction +# inputStateAndRefs: +# annotation: [] +# type: List +# referenceStateAndRefs: +# annotation: [] +# type: List + createWithStateAndRefs: + annotations: [] + default: false + type: public + returnType: UtxoLedgerTransactionInternal + params: + wireTransaction: + annotation: [] + type: WireTransaction + inputStateAndRefs: + annotation: [] + type: List> + referenceStateAndRefs: + annotation: [] + type: List> net.corda.v5.ledger.utxo.observer.TokenStateObserverContext: annotations: [] type: public interface From 388a09599beb91147db8f6aae614915d82d0410b Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Tue, 19 Dec 2023 12:03:56 +0000 Subject: [PATCH 03/10] renaming --- gradle.properties | 2 +- .../scans/corda-ledger-utxo-5.2.0.yaml | 17 +---------------- .../corda/v5/ledger/utxo/UtxoLedgerService.java | 2 +- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/gradle.properties b/gradle.properties index 03b69684a8..1e4a59c05e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ cordaProductVersion = 5.2.0 # NOTE: update this each time this module contains a breaking change ## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to ## a per module property in which case module versions can change independently. -cordaApiRevision = 17-julia1 +cordaApiRevision = 17-julia2 # Main kotlin.stdlib.default.dependency = false diff --git a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml index a6b2c4dbe3..5a20af106e 100644 --- a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml +++ b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml @@ -578,7 +578,7 @@ net.corda.v5.ledger.utxo.UtxoLedgerService: ledgerTransaction: annotation: [] type: net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction - sendWireTransaction: + sendAsLedgerTransaction: annotations: - Suspendable default: false @@ -609,21 +609,6 @@ net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory wireTransaction: annotation: [] type: WireTransaction -# create: -# annotations: [] -# default: false -# type: public -# returnType: UtxoLedgerTransactionInternal -# params: -# wireTransaction: -# annotation: [] -# type: WireTransaction -# inputStateAndRefs: -# annotation: [] -# type: List -# referenceStateAndRefs: -# annotation: [] -# type: List createWithStateAndRefs: annotations: [] default: false diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java index aae86fbbdf..7096d94f54 100644 --- a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java @@ -291,7 +291,7 @@ UtxoSignedTransaction receiveTransaction( * @throws CordaRuntimeException If transaction verification fails on the receiving sessions. */ @Suspendable - void sendWireTransaction( + void sendAsLedgerTransaction( @NotNull UtxoSignedTransaction signedTransaction, @NotNull List sessions ); From dcc8d5b29d614e7718dfe61116afb99cdea91a72 Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Wed, 20 Dec 2023 14:31:39 +0000 Subject: [PATCH 04/10] addressing pr comments --- .../java/net/corda/v5/ledger/utxo/UtxoLedgerService.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java index 7096d94f54..7ee2e3fe9d 100644 --- a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java @@ -284,10 +284,10 @@ UtxoSignedTransaction receiveTransaction( ); /** - * Sends the wire transaction to counterparty sessions. + * Sends an unsigned copy of the base LedgerTransaction to counterparty sessions. * + * @param signedTransaction The {@link UtxoSignedTransaction} whose correspondent {@link UtxoLedgerTransaction} will be sent. * @param sessions The counterparties who receive the transaction. - * @param signedTransaction The {@link UtxoSignedTransaction} to send. * @throws CordaRuntimeException If transaction verification fails on the receiving sessions. */ @Suspendable @@ -297,11 +297,10 @@ void sendAsLedgerTransaction( ); /** - * Receives a verified transaction from the counterparty session and persists it to the vault. + * Receives a transaction from the counterparty session and persists it to the vault. * * @param session The counterparty to receive a transaction from. * @return the {@link UtxoLedgerTransaction} received from counterparty. - * @throws CordaRuntimeException If the transaction received fails verification. */ @NotNull @Suspendable From 9979c6d3ad8ff07f771d62ceb19249a8491b39b3 Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Wed, 20 Dec 2023 14:44:00 +0000 Subject: [PATCH 05/10] addressing pr comments --- .../main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java index 7ee2e3fe9d..cfa71db0d1 100644 --- a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java @@ -288,7 +288,6 @@ UtxoSignedTransaction receiveTransaction( * * @param signedTransaction The {@link UtxoSignedTransaction} whose correspondent {@link UtxoLedgerTransaction} will be sent. * @param sessions The counterparties who receive the transaction. - * @throws CordaRuntimeException If transaction verification fails on the receiving sessions. */ @Suspendable void sendAsLedgerTransaction( @@ -297,7 +296,7 @@ void sendAsLedgerTransaction( ); /** - * Receives a transaction from the counterparty session and persists it to the vault. + * Receives a ledger transaction from the counterparty session. * * @param session The counterparty to receive a transaction from. * @return the {@link UtxoLedgerTransaction} received from counterparty. From 81a9cf0d2b7b6765185c9793e8ddf39b05a9d041 Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Wed, 20 Dec 2023 16:11:56 +0000 Subject: [PATCH 06/10] updating version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 95e765185c..ff3f0c1f1f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ cordaProductVersion = 5.2.0 # NOTE: update this each time this module contains a breaking change ## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to ## a per module property in which case module versions can change independently. -cordaApiRevision = 20 +cordaApiRevision = 22 # Main kotlin.stdlib.default.dependency = false From 6b6cf85d2d6b6311cd7fbe6eb0c84b4f34006a10 Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Wed, 20 Dec 2023 17:20:40 +0000 Subject: [PATCH 07/10] fixing yaml --- .../scans/corda-ledger-utxo-5.2.0.yaml | 73 ++++++++----------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml index 5a20af106e..2430859522 100644 --- a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml +++ b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml @@ -474,6 +474,18 @@ net.corda.v5.ledger.utxo.UtxoLedgerService: annotation: - NotNull type: net.corda.v5.ledger.utxo.transaction.UtxoTransactionValidator + receiveLedgerTransaction: + annotations: + - Suspendable + - NotNull + default: false + type: public abstract + returnType: net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction + params: + session: + annotation: + - NotNull + type: net.corda.v5.application.messaging.FlowSession receiveTransaction: annotations: - Suspendable @@ -526,18 +538,21 @@ net.corda.v5.ledger.utxo.UtxoLedgerService: annotation: - NotNull type: net.corda.v5.application.messaging.FlowSession - receiveLedgerTransaction: + sendAsLedgerTransaction: annotations: - Suspendable - - NotNull default: false type: public abstract - returnType: net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction + returnType: void params: - session: + signedTransaction: annotation: - NotNull - type: net.corda.v5.application.messaging.FlowSession + type: net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction + sessions: + annotation: + - NotNull + type: java.util.List sendTransaction: annotations: - Suspendable @@ -578,52 +593,24 @@ net.corda.v5.ledger.utxo.UtxoLedgerService: ledgerTransaction: annotation: [] type: net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction - sendAsLedgerTransaction: - annotations: - - Suspendable - default: false - type: public abstract - returnType: void - params: - signedTransaction: - annotation: - - NotNull - type: net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction - sessions: - annotation: - - NotNull - type: java.util.List -net.corda.ledger.utxo.flow.impl.transaction.factory.UtxoLedgerTransactionFactory: - annotations: [] +net.corda.v5.ledger.utxo.VisibilityChecker: + annotations: + - DoNotImplement type: public interface extends: [] interface: true methods: - create: + containsMySigningKeys: annotations: - Suspendable default: false - type: public - returnType: UtxoLedgerTransactionInternal - params: - wireTransaction: - annotation: [] - type: WireTransaction - createWithStateAndRefs: - annotations: [] - default: false - type: public - returnType: UtxoLedgerTransactionInternal + type: public abstract + returnType: boolean params: - wireTransaction: - annotation: [] - type: WireTransaction - inputStateAndRefs: - annotation: [] - type: List> - referenceStateAndRefs: - annotation: [] - type: List> + keys: + annotation: + - NotNull + type: Iterable net.corda.v5.ledger.utxo.observer.TokenStateObserverContext: annotations: [] type: public interface From a9911081e36308afe9431630e521e6dc746affe3 Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Thu, 21 Dec 2023 16:56:19 +0000 Subject: [PATCH 08/10] updating version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ff3f0c1f1f..74c5dfbae8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ cordaProductVersion = 5.2.0 # NOTE: update this each time this module contains a breaking change ## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to ## a per module property in which case module versions can change independently. -cordaApiRevision = 22 +cordaApiRevision = 24 # Main kotlin.stdlib.default.dependency = false From 4683589800cc253ac6ceb9dcac51163ed471a215 Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Thu, 28 Dec 2023 11:57:13 +0000 Subject: [PATCH 09/10] updating version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 74c5dfbae8..ea7a8a5723 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ cordaProductVersion = 5.2.0 # NOTE: update this each time this module contains a breaking change ## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to ## a per module property in which case module versions can change independently. -cordaApiRevision = 24 +cordaApiRevision = 25 # Main kotlin.stdlib.default.dependency = false From 915999942b1180d205f476ead9e98e5ec1220ec2 Mon Sep 17 00:00:00 2001 From: JuliaFilipczak Date: Mon, 8 Jan 2024 11:58:10 +0000 Subject: [PATCH 10/10] updating version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ea7a8a5723..b3c5e874a8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ cordaProductVersion = 5.2.0 # NOTE: update this each time this module contains a breaking change ## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to ## a per module property in which case module versions can change independently. -cordaApiRevision = 25 +cordaApiRevision = 27 # Main kotlin.stdlib.default.dependency = false