Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Switched back boolean
  • Loading branch information
hswick committed Mar 27, 2018
commit 284228f3a577662c66dbb29ad68e36b5dd7d8b7d
24 changes: 12 additions & 12 deletions contracts/BasicVerificationGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ contract BasicVerificationGame {
NewGame(gameId, solver, verifier);
}

function status(bytes32 gameId) public view returns (uint8) {
return uint8(games[gameId].state);
}

function gameData(bytes32 gameId) public view returns (uint low, uint med, uint high) {
VerificationGame storage game = games[gameId];
low = game.lowStep;
med = game.medStep;
high = game.highStep;
}

function query(bytes32 gameId, uint stepNumber) public {
VerificationGame storage game = games[gameId];

Expand All @@ -82,7 +93,7 @@ contract BasicVerificationGame {
} else {
// this next step must be in the correct range
//can only query between 0...2049
require(stepNumber >= game.lowStep && stepNumber < game.highStep);
require(stepNumber > game.lowStep && stepNumber < game.highStep);

// if this is NOT the first query, update the steps and assign the correct hash
// (if this IS the first query, we just want to initialize medStep and medHash)
Expand Down Expand Up @@ -211,15 +222,4 @@ contract BasicVerificationGame {
}
//FinalData(stepOutput, keccak256(stepOutput));
}

function status(bytes32 gameId) public view returns (uint8) {
return uint8(games[gameId].state);
}

function gameData(bytes32 gameId) public view returns (uint low, uint med, uint high) {
VerificationGame storage game = games[gameId];
low = game.lowStep;
med = game.medStep;
high = game.highStep;
}
}