Skip to content

Commit

Permalink
CORE-19087 Add force backchain option to send tx (#1510)
Browse files Browse the repository at this point in the history
Add a new function to UtxoLedgerService API to force backchain resolution
Rename sendAsLedgerTransaction to sendLedgerTransaction
  • Loading branch information
nkovacsx authored Feb 15, 2024
1 parent b5616f7 commit 5eda785
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 46
cordaApiRevision = 47

# Main
kotlin.stdlib.default.dependency = false
Expand Down
1 change: 1 addition & 0 deletions ledger/ledger-common/scans/corda-ledger-common-5.2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ net.corda.v5.ledger.common.NotaryLookup:
type: net.corda.v5.base.types.MemberX500Name
net.corda.v5.ledger.common.transaction.CordaPackageSummary:
annotations:
- CordaSerializable
- DoNotImplement
type: public interface
extends: []
Expand Down
40 changes: 37 additions & 3 deletions ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ net.corda.v5.ledger.utxo.UtxoLedgerService:
annotation:
- NotNull
type: net.corda.v5.application.messaging.FlowSession
sendAsLedgerTransaction:
sendLedgerTransaction:
annotations:
- Suspendable
default: false
Expand Down Expand Up @@ -580,6 +580,21 @@ net.corda.v5.ledger.utxo.UtxoLedgerService:
annotation:
- NotNull
type: java.util.List<net.corda.v5.application.messaging.FlowSession>
sendTransactionWithBackchain:
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.application.messaging.FlowSession>
sendUpdatedTransactionBuilder:
annotations:
- Suspendable
Expand Down Expand Up @@ -1100,11 +1115,28 @@ net.corda.v5.ledger.utxo.query.registration.VaultNamedQueryBuilder:
annotation:
- NotNull
type: "net.corda.v5.ledger.utxo.query.VaultNamedQueryTransformer<?, ?>"
orderBy:
annotations:
- NotNull
default: false
type: public abstract
returnType: net.corda.v5.ledger.utxo.query.registration.VaultNamedQueryBuilder
params:
columnExpression:
annotation:
- NotNull
type: String
register:
annotations: []
default: false
type: public abstract
returnType: void
selectUnconsumedStatesOnly:
annotations:
- NotNull
default: false
type: public abstract
returnType: net.corda.v5.ledger.utxo.query.registration.VaultNamedQueryBuilder
whereJson:
annotations:
- NotNull
Expand Down Expand Up @@ -1232,7 +1264,8 @@ net.corda.v5.ledger.utxo.token.selection.TokenBalance:
type: public abstract
returnType: java.math.BigDecimal
net.corda.v5.ledger.utxo.token.selection.TokenBalanceCriteria:
annotations: []
annotations:
- CordaSerializable
type: public final class
extends: null
implements: []
Expand Down Expand Up @@ -1339,7 +1372,8 @@ net.corda.v5.ledger.utxo.token.selection.TokenClaim:
- NotNull
type: java.util.List<net.corda.v5.ledger.utxo.StateRef>
net.corda.v5.ledger.utxo.token.selection.TokenClaimCriteria:
annotations: []
annotations:
- CordaSerializable
type: public final class
extends: null
implements: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,20 @@ void sendTransaction(
@NotNull List<FlowSession> sessions
);

/**
* Sends the transaction to counterparty sessions and forces backchain resolution.
*
* @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 sendTransactionWithBackchain(
@NotNull UtxoSignedTransaction signedTransaction,
@NotNull List<FlowSession> sessions
);


/**
* Receives a verified transaction from the counterparty session and persists it to the vault.
*
Expand All @@ -301,7 +315,7 @@ UtxoSignedTransaction receiveTransaction(
* @param sessions The counterparties who receive the transaction.
*/
@Suspendable
void sendAsLedgerTransaction(
void sendLedgerTransaction(
@NotNull UtxoSignedTransaction signedTransaction,
@NotNull List<FlowSession> sessions
);
Expand Down

0 comments on commit 5eda785

Please sign in to comment.