This commit is contained in:
djmil 2023-11-27 16:40:11 +01:00
parent d647d4eebf
commit cc297ef23c
3 changed files with 6 additions and 4 deletions

View File

@ -21,6 +21,7 @@ public class GameResultContract implements net.corda.v5.ledger.utxo.Contract {
switch (command.getAction()) { switch (command.getAction()) {
case SURRENDER: case SURRENDER:
System.out.println("game surrender validate");
command.validateSurrender(trx); command.validateSurrender(trx);
break; break;

View File

@ -62,7 +62,7 @@ public class CommitTrx implements SubFlow<SecureHash> {
List<FlowSession> sessionsList = new LinkedList<FlowSession>(Arrays.asList(session)); List<FlowSession> sessionsList = new LinkedList<FlowSession>(Arrays.asList(session));
if (custodyName != null) { if (custodyName != null) {
System.out.println("we have a custoduan" + custodyName.getCommonName() ); System.out.println("we have a custoduan " + custodyName.getCommonName() );
sessionsList.add(flowMessaging.initiateFlow(custodyName)); sessionsList.add(flowMessaging.initiateFlow(custodyName));
} }
@ -71,7 +71,8 @@ public class CommitTrx implements SubFlow<SecureHash> {
.getTransaction() .getTransaction()
.getId(); .getId();
System.out.println("Trx commited "+trxId); System.out.println("Trx commited "+trxId);
log.info("GameState commit " +trxId); log.info("GameState commit " +trxId);
return trxId; return trxId;
} }

View File

@ -33,7 +33,7 @@ public class CommitTrxResponder implements ResponderFlow {
UtxoTransactionValidator txValidator = trxToValidate -> { UtxoTransactionValidator txValidator = trxToValidate -> {
try { try {
//checkParticipants(session, trxToValidate); //checkParticipants(session, trxToValidate);
System.out.println("commit responder");
/* /*
* Other checks / actions ? * Other checks / actions ?
*/ */
@ -57,7 +57,7 @@ public class CommitTrxResponder implements ResponderFlow {
@Suspendable @Suspendable
void checkParticipants(FlowSession session, UtxoLedgerTransaction gameStateUtxo) throws ParticipantException { void checkParticipants(FlowSession session, UtxoLedgerTransaction gameStateUtxo) throws ParticipantException {
System.out.println("commit responder");
final GameInfo info = new GameInfo(gameStateUtxo); final GameInfo info = new GameInfo(gameStateUtxo);
final var conterpartyName = session.getCounterparty(); final var conterpartyName = session.getCounterparty();
if (info.issuer.compareTo(conterpartyName) != 0) if (info.issuer.compareTo(conterpartyName) != 0)