Skip to content

Commit

Permalink
CORE-17816 contract verifying notary APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
jennyang-r3 committed Dec 1, 2023
1 parent 7fdf09d commit edcf164
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
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 = 10
cordaApiRevision = 11

# Main
kotlinVersion = 1.8.21
Expand Down
21 changes: 19 additions & 2 deletions ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,16 @@ net.corda.v5.ledger.utxo.UtxoLedgerService:
annotation:
- NotNull
type: net.corda.v5.application.messaging.FlowSession
verifyContract:
annotations:
- Suspendable
default: false
type: public abstract
returnType: void
params:
ledgerTransaction:
annotation: []
type: net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction
net.corda.v5.ledger.utxo.VisibilityChecker:
annotations:
- DoNotImplement
Expand Down Expand Up @@ -1623,6 +1633,13 @@ net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction:
default: false
type: public abstract
returnType: net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction
params:
inputStateAndRefs:
annotation: []
type: java.util.List<net.corda.v5.ledger.utxo.StateAndRef<?>>
referenceStateAndRefs:
annotation: []
type: java.util.List<net.corda.v5.ledger.utxo.StateAndRef<?>>
net.corda.v5.ledger.utxo.transaction.UtxoTransactionBuilder:
annotations:
- DoNotImplement
Expand Down Expand Up @@ -2017,10 +2034,10 @@ net.corda.v5.ledger.utxo.transaction.filtered.UtxoFilteredTransactionBuilder:
type: public abstract
returnType: net.corda.v5.ledger.utxo.transaction.filtered.UtxoFilteredTransactionBuilder
params:
predicate:
indexes:
annotation:
- NotNull
type: java.util.function.Predicate<net.corda.v5.ledger.utxo.ContractState>
type: java.util.List<Integer>
withOutputStatesSize:
annotations:
- Suspendable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ public interface UtxoLedgerService {
@Suspendable
UtxoTransactionBuilder createTransactionBuilder();

/**
* Verifies {@link UtxoLedgerTransaction} in the notary server when using contract-verifying-notary.
*
* @param ledgerTransaction The {@link UtxoLedgerTransaction} to verify.
*/
@Suspendable
void verifyContract(UtxoLedgerTransaction ledgerTransaction);

/**
* Resolves the specified {@link StateRef} instances into {@link StateAndRef} instances of the specified {@link ContractState} type.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,15 @@ public interface UtxoSignedTransaction extends TransactionWithMetadata {
@NotNull
@Suspendable
UtxoLedgerTransaction toLedgerTransaction();

/**
* Converts the current {@link UtxoSignedTransaction} into a {@link UtxoLedgerTransaction}.
*
* @param inputStateAndRefs input state and state refs associated with the {@link UtxoSignedTransaction}
* @param referenceStateAndRefs reference state and state refs
* @return Returns a {@link UtxoLedgerTransaction} from the current {@link UtxoSignedTransaction}.
*/
@NotNull
@Suspendable
UtxoLedgerTransaction toLedgerTransaction(List<StateAndRef<?>> inputStateAndRefs, List<StateAndRef<?>> referenceStateAndRefs);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.jetbrains.annotations.NotNull;

import java.security.PublicKey;
import java.util.List;
import java.util.function.Predicate;

/**
Expand Down Expand Up @@ -178,6 +179,19 @@ public interface UtxoFilteredTransactionBuilder {
@Suspendable
UtxoFilteredTransactionBuilder withOutputStates(@NotNull Predicate<ContractState> predicate);

/**
* Includes an audit proof of the output state refs component group from a {@link UtxoSignedTransaction} in the
* current {@link UtxoFilteredTransaction}.
*
* @param indexes index of transaction to include its output to {@link UtxoFilteredTransaction}
* @return Returns the current {@link UtxoFilteredTransaction} including the filtered output state refs component
* group.
*/
@Suspendable
@NotNull
UtxoFilteredTransactionBuilder withOutputStates(@NotNull List<Integer> indexes);


/**
* Includes a size proof of the commands component group from a {@link UtxoSignedTransaction} in the current
* {@link UtxoFilteredTransaction}.
Expand Down

0 comments on commit edcf164

Please sign in to comment.