From d12fcee5cca731e558d538611850673dfbdeb74b Mon Sep 17 00:00:00 2001 From: djmil Date: Tue, 28 Nov 2023 17:18:21 +0100 Subject: [PATCH] trx responder --- backend/src/main/resources/application.properties | 2 +- .../cordacheckers/gamestate/CommitTrxResponder.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index aa7972a..e3874dc 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -2,7 +2,7 @@ trust.store=classpath:keystore/truststore.p12 trust.store.password=test123 -corda.host=https://192.168.10.8 +corda.host=https://localhost corda.port=8888 corda.root.login=admin corda.root.passw=admin diff --git a/corda/workflows/src/main/java/djmil/cordacheckers/gamestate/CommitTrxResponder.java b/corda/workflows/src/main/java/djmil/cordacheckers/gamestate/CommitTrxResponder.java index da88489..030cf58 100644 --- a/corda/workflows/src/main/java/djmil/cordacheckers/gamestate/CommitTrxResponder.java +++ b/corda/workflows/src/main/java/djmil/cordacheckers/gamestate/CommitTrxResponder.java @@ -30,10 +30,12 @@ public class CommitTrxResponder implements ResponderFlow { @Suspendable @Override public void call(FlowSession session) { + log.debug("_______ CommitTrxResponder Session: " + session); + log.debug("_______ CommitTrxResponder, myName: " + memberLookup.myInfo().getName()); + UtxoTransactionValidator txValidator = trxToValidate -> { try { - //checkParticipants(session, trxToValidate); - System.out.println("Approval for " + trxToValidate.getId()); + checkParticipants(session, trxToValidate); /* * Other checks / actions ? */ @@ -53,6 +55,9 @@ public class CommitTrxResponder implements ResponderFlow { // Log Corda's specific message about finality validation failure log.warn(e.getMessage()); } + catch (Throwable t) { + log.debug("_______ CommitTrxResponder: bad exception", t); + } } @Suspendable @@ -64,7 +69,7 @@ public class CommitTrxResponder implements ResponderFlow { throw new ParticipantException("Issuer", conterpartyName, info.issuer); final var myName = memberLookup.myInfo().getName(); - System.out.println(" my name" + myName + " opponentName "+ conterpartyName); + if (myName.getOrganizationUnit().equals("Custodian")) return; // Custodian shall not validate state's counterparty