From 7c96bc3fc58aff60c5e69a6bde752c7e68422dbc Mon Sep 17 00:00:00 2001 From: djmil Date: Tue, 28 Nov 2023 22:00:55 +0100 Subject: [PATCH] even moar logs and fixes --- .../gamestate/CommitTrxResponder.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) 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 f17117d..e14e227 100644 --- a/corda/workflows/src/main/java/djmil/cordacheckers/gamestate/CommitTrxResponder.java +++ b/corda/workflows/src/main/java/djmil/cordacheckers/gamestate/CommitTrxResponder.java @@ -22,8 +22,8 @@ public class CommitTrxResponder implements ResponderFlow { private final static Logger log = LoggerFactory.getLogger(CommitTrxResponder.class); - @CordaInject - public MemberLookup memberLookup; + // @CordaInject + // public MemberLookup memberLookup; @CordaInject public UtxoLedgerService utxoLedgerService; @@ -31,9 +31,11 @@ public class CommitTrxResponder implements ResponderFlow { @Suspendable @Override public void call(FlowSession session) { + log.info("----> CommitTrxResponder: Session "+session); try { UtxoTransactionValidator txValidator = trxToValidate -> { - checkParticipants(session, trxToValidate); + log.info("----> Checking participants... "); + //checkParticipants(session, trxToValidate); /* * Other checks / actions ? @@ -53,21 +55,21 @@ public class CommitTrxResponder implements ResponderFlow { } } - @Suspendable - void checkParticipants(FlowSession session, UtxoLedgerTransaction gameStateUtxo) { - final GameInfo info = new GameInfo(gameStateUtxo); - final var conterpartyName = session.getCounterparty(); - if (info.issuer.compareTo(conterpartyName) != 0) - throw new CordaRuntimeException("Bad Issuer. Expected: " + conterpartyName + " actual: " + info.issuer); + // @Suspendable + // void checkParticipants(FlowSession session, UtxoLedgerTransaction gameStateUtxo) { + // final GameInfo info = new GameInfo(gameStateUtxo); + // final var conterpartyName = session.getCounterparty(); + // if (info.issuer.compareTo(conterpartyName) != 0) + // throw new CordaRuntimeException("Bad Issuer. Expected: " + conterpartyName + " actual: " + info.issuer); - final var myInfo = memberLookup.myInfo(); - if (VNode.isCordaCherckersCustodian(myInfo)) - return; // Custodian shall not validate state's counterparty + // final var myInfo = memberLookup.myInfo(); + // if (VNode.isCordaCherckersCustodian(myInfo)) + // return; // Custodian shall not validate state's counterparty - final var opponentName = info.state.getOpponentName(myInfo.getName()); // throws NotInvolved - if (conterpartyName.compareTo(opponentName) != 0) - throw new CordaRuntimeException("Bad Opponent. Expcted: " + conterpartyName + " axtual: " + opponentName); - } + // final var opponentName = info.state.getOpponentName(myInfo.getName()); // throws NotInvolved + // if (conterpartyName.compareTo(opponentName) != 0) + // throw new CordaRuntimeException("Bad Opponent. Expcted: " + conterpartyName + " axtual: " + opponentName); + // } // public static class ParticipantException extends Exception { // public ParticipantException(String role, MemberX500Name expected,