File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Features/oracle-primenumber/service/src/main/java/net/corda/examples/oracle/service/service Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 55import net .corda .core .node .ServiceHub ;
66import net .corda .core .node .services .CordaService ;
77import net .corda .core .serialization .SingletonSerializeAsToken ;
8+ import net .corda .core .transactions .ComponentVisibilityException ;
89import net .corda .core .transactions .FilteredTransaction ;
910import net .corda .core .transactions .FilteredTransactionVerificationException ;
1011import net .corda .examples .oracle .base .contract .PrimeContract ;
@@ -74,6 +75,15 @@ public TransactionSignature sign(FilteredTransaction ftx) throws FilteredTransac
7475
7576 // Is it a Merkle tree we are willing to sign over?
7677 boolean isValidMerkleTree = ftx .checkWithFun (this ::isCommandWithCorrectPrimeAndIAmSigner );
78+ try {
79+ /**
80+ * Function that checks if all of the commands that should be signed by the input public key are visible.
81+ * This functionality is required from Oracles to check that all of the commands they should sign are visible.
82+ */
83+ ftx .checkCommandVisibility (services .getMyInfo ().getLegalIdentities ().get (0 ).getOwningKey ());
84+ } catch (ComponentVisibilityException e ) {
85+ e .printStackTrace ();
86+ }
7787
7888 if (isValidMerkleTree ) {
7989 return services .createSignature (ftx , myKey );
You can’t perform that action at this time.
0 commit comments