From e7a29962347c9aed3008040ff60d6bab792a5bc5 Mon Sep 17 00:00:00 2001 From: djmil Date: Tue, 28 Nov 2023 18:19:45 +0100 Subject: [PATCH] game-proposal: verify --- .../contracts/GameProposalContract.java | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/corda/contracts/src/main/java/djmil/cordacheckers/contracts/GameProposalContract.java b/corda/contracts/src/main/java/djmil/cordacheckers/contracts/GameProposalContract.java index 34c3b9b..e0962f3 100644 --- a/corda/contracts/src/main/java/djmil/cordacheckers/contracts/GameProposalContract.java +++ b/corda/contracts/src/main/java/djmil/cordacheckers/contracts/GameProposalContract.java @@ -14,31 +14,34 @@ public class GameProposalContract implements net.corda.v5.ledger.utxo.Contract { @Override public void verify(UtxoLedgerTransaction trx) { - log.info("GameProposalContract.verify() called"); + log.info("--> GameProposalContract.verify() called"); + - requireThat(trx.getCommands().size() == 1, GameCommand.REQUIRE_SINGLE_COMMAND); - final GameCommand command = getSingleCommand(trx, GameCommand.class); + // requireThat(trx.getCommands().size() == 1, GameCommand.REQUIRE_SINGLE_COMMAND); + // final GameCommand command = getSingleCommand(trx, GameCommand.class); - switch (command.getAction()) { - case GAME_PROPOSAL_CREATE: - command.validateGameProposalCreate(trx); - break; + // log.info("--> GameProposalContract.verify: command "+command.getAction()); - case GAME_PROPOSAL_ACCEPT: - command.validateGameProposalAccept(trx); - break; + // switch (command.getAction()) { + // case GAME_PROPOSAL_CREATE: + // command.validateGameProposalCreate(trx); + // break; - case GAME_PROPOSAL_REJECT: - command.validateGameProposalReject(trx); - break; + // case GAME_PROPOSAL_ACCEPT: + // command.validateGameProposalAccept(trx); + // break; - case GAME_PROPOSAL_CANCEL: - command.validateGameProposalCancel(trx); - break; + // case GAME_PROPOSAL_REJECT: + // command.validateGameProposalReject(trx); + // break; - default: - throw new GameCommand.ActionException(); - } + // case GAME_PROPOSAL_CANCEL: + // command.validateGameProposalCancel(trx); + // break; + + // default: + // throw new GameCommand.ActionException(); + // } } }