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 e0962f3..b055854 100644 --- a/corda/contracts/src/main/java/djmil/cordacheckers/contracts/GameProposalContract.java +++ b/corda/contracts/src/main/java/djmil/cordacheckers/contracts/GameProposalContract.java @@ -17,31 +17,33 @@ public class GameProposalContract implements net.corda.v5.ledger.utxo.Contract { 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); - // log.info("--> GameProposalContract.verify: command "+command.getAction()); + log.info("--> GameProposalContract.verify: command "+command.getAction()); - // switch (command.getAction()) { - // case GAME_PROPOSAL_CREATE: - // command.validateGameProposalCreate(trx); - // break; + switch (command.getAction()) { + case GAME_PROPOSAL_CREATE: + command.validateGameProposalCreate(trx); + break; - // case GAME_PROPOSAL_ACCEPT: - // command.validateGameProposalAccept(trx); - // break; + case GAME_PROPOSAL_ACCEPT: + command.validateGameProposalAccept(trx); + break; - // case GAME_PROPOSAL_REJECT: - // command.validateGameProposalReject(trx); - // break; + case GAME_PROPOSAL_REJECT: + command.validateGameProposalReject(trx); + break; - // case GAME_PROPOSAL_CANCEL: - // command.validateGameProposalCancel(trx); - // break; + case GAME_PROPOSAL_CANCEL: + command.validateGameProposalCancel(trx); + break; - // default: - // throw new GameCommand.ActionException(); - // } + default: + throw new GameCommand.ActionException(); + } + + log.info("--> GameProposalContract.verify: SUCCESS"); } }