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()) {
case SURRENDER:
System.out.println("game surrender validate");
command.validateSurrender(trx);
break;

View File

@ -62,7 +62,7 @@ public class CommitTrx implements SubFlow<SecureHash> {
List<FlowSession> sessionsList = new LinkedList<FlowSession>(Arrays.asList(session));
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));
}
@ -72,6 +72,7 @@ public class CommitTrx implements SubFlow<SecureHash> {
.getId();
System.out.println("Trx commited "+trxId);
log.info("GameState commit " +trxId);
return trxId;
}

View File

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