3

Using the online solidity compiler startGame() returns false, but using truffle this function returns a long hex string: 0xf697bd4ff4f5574f3cf73cd46a18087a5a0cf1aa1580fd4992ab20f574a808fe

function startGame() critical returns (bool) {
    Player player = players[msg.sender];
    if (player.ready) { 
        if (player.balance < minimumwager) { throw; }
            waiting.push(player);
            numWaiting++;
            if (numWaiting > 1) { 
                var thismatchup =  makeMatchup();
                player.playing = true;
                matchupMade(thismatchup); 
                return true; 
            }
            else {
                player.playing = true;
                playerWaiting(player.ethaddress);
                return false; 
            }
        }
    }
}
jrbedard
  • 524
  • 1
  • 6
  • 15
ethereal
  • 1,805
  • 2
  • 14
  • 25
  • You're getting a transaction hash in Truffle. You need to use events and this overview about transactions could help: http://ethereum.stackexchange.com/questions/765/what-is-the-difference-between-a-transaction-and-a-call – eth Oct 21 '16 at 05:24
  • No problem. I posted an answer and feel free to edit it or post your own answer that could help others. – eth Oct 21 '16 at 18:01

1 Answers1

1

Invoking startGame with .call() in Truffle solved the issue: startGame.call()

eth
  • 85,679
  • 53
  • 285
  • 406