Skip to content

Commit

Permalink
Merge pull request #181 from kleros/feat/t2cr-update
Browse files Browse the repository at this point in the history
fix(t2cr): push tokenID to list and return named values
  • Loading branch information
eccentricexit committed Nov 27, 2018
2 parents f01b727 + f255e6f commit eaa0cac
Showing 1 changed file with 48 additions and 4 deletions.
52 changes: 48 additions & 4 deletions contracts/standard/permission/ArbitrableTokenList.sol
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
token.name = _name;
token.ticker = _ticker;
token.addr = _addr;
tokensList.push(_tokenID);
} else
require(
!token.requests[token.requests.length - 1].disputed,
Expand Down Expand Up @@ -779,6 +780,33 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
/* Interface Views */
/** @dev Returns token information. Includes length of requests array.
* @param _tokenID The ID of the token.
* @return The token information.
*/
function getTokenInfo(bytes32 _tokenID)
external
view
returns (
TokenStatus status,
string name,
address addr,
string ticker,
uint lastAction,
uint numberOfRequests
)
{
Token storage token = tokens[_tokenID];
return (
token.status,
token.name,
token.addr,
token.ticker,
token.lastAction,
token.requests.length
);
}
/** @dev Gets the info on a request of a token.
* @param _tokenID The ID of the token.
* @param _request The position of the request we want.
Expand All @@ -787,7 +815,18 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
function getRequestInfo(bytes32 _tokenID, uint _request)
external
view
returns (bool, uint, uint, uint, uint, uint, uint, address[3], bool)
returns (
bool disputed,
uint disputeID,
uint firstContributionTime,
uint arbitrationFeesWaitingTime,
uint timeToChallenge,
uint challengeRewardBalance,
uint challengeReward,
address[3] parties,
bool appealed,
uint numberOfRounds
)
{
Token storage token = tokens[_tokenID];
Request storage request = token.requests[_request];
Expand All @@ -800,7 +839,8 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
request.challengeRewardBalance,
request.challengeReward,
request.parties,
request.appealed
request.appealed,
request.rounds.length
);
}
Expand All @@ -813,7 +853,12 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
function getRoundInfo(bytes32 _tokenID, uint _request, uint _round)
external
view
returns (uint, uint[3], bool, RulingOption)
returns (
uint requiredFeeStake,
uint[3] paidFees,
bool loserFullyFunded,
RulingOption ruling
)
{
Token storage token = tokens[_tokenID];
Request storage request = token.requests[_request];
Expand Down Expand Up @@ -937,5 +982,4 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
}
}
}
}

0 comments on commit eaa0cac

Please sign in to comment.