Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DA5-6 persistDraftSignedTransaction, findDraftSignedTransaction #1352

Merged
merged 4 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
steps:
- uses: morrisoncole/[email protected]
with:
title-regex: '^((CORDA|EG|ENT|INFRA|CORE|DOC|ES)-\d+)(.*)'
title-regex: '^((CORDA|EG|ENT|INFRA|CORE|DOC|ES|DA5)-\d+)(.*)'
on-failed-regex-comment: "PR title failed to match regex -> `%regex%`"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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 = 7
cordaApiRevision = 8

# Main
kotlinVersion = 1.8.21
Expand Down
23 changes: 23 additions & 0 deletions ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,18 @@ net.corda.v5.ledger.utxo.UtxoLedgerService:
annotation:
- NotNull
type: java.util.List<net.corda.v5.application.messaging.FlowSession>
findDraftSignedTransaction:
annotations:
- Suspendable
- Nullable
default: false
type: public abstract
returnType: net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction
params:
id:
annotation:
- NotNull
type: net.corda.v5.crypto.SecureHash
findLedgerTransaction:
annotations:
- Suspendable
Expand Down Expand Up @@ -389,6 +401,17 @@ net.corda.v5.ledger.utxo.UtxoLedgerService:
annotation:
- NotNull
type: Class<T>
persistDraftSignedTransaction:
annotations:
- Suspendable
default: false
type: public abstract
returnType: void
params:
utxoSignedTransaction:
annotation:
- NotNull
type: net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction
query:
annotations:
- Suspendable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.corda.v5.base.annotations.Suspendable;
import net.corda.v5.base.exceptions.CordaRuntimeException;
import net.corda.v5.crypto.SecureHash;
import net.corda.v5.ledger.common.transaction.TransactionSignatureException;
import net.corda.v5.ledger.utxo.query.VaultNamedParameterizedQuery;
import net.corda.v5.ledger.utxo.query.VaultNamedQueryFactory;
import net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction;
Expand Down Expand Up @@ -331,4 +332,30 @@ UtxoSignedTransaction receiveTransaction(
@Suspendable
@NotNull
<R> VaultNamedParameterizedQuery<R> query(@NotNull String queryName, @NotNull Class<R> resultClass);

/**
* Persists a non-finalized (draft) transaction.
* It executes the same checks as the finalization does before its initial persist.
* So the transaction and all of its signatures need to be valid, but there may be missing signatures.
* <p>
* @param utxoSignedTransaction The {@link UtxoSignedTransaction} to persist.
* @throws ContractVerificationException if the transaction fails contract verification.
* @throws TransactionSignatureException if a signature of the transaction fails verification.
* @throws IllegalStateException if the transaction does not have any signatures.
*/
@Suspendable
void persistDraftSignedTransaction(
@NotNull UtxoSignedTransaction utxoSignedTransaction
);

/**
* Finds a draft {@link UtxoSignedTransaction} in the vault by the specified transaction ID.
* Draft transactions have not been finalized, so they may have missing signatures.
*
* @param id The ID of the {@link UtxoSignedTransaction} to find.
* @return Returns the {@link UtxoSignedTransaction} if it has been recorded previously, or null if no transaction could be found.
*/
@Nullable
@Suspendable
UtxoSignedTransaction findDraftSignedTransaction(@NotNull SecureHash id);
}