diff --git a/contracts/IColony.sol b/contracts/IColony.sol index bf9596823c..2025a42b27 100644 --- a/contracts/IColony.sol +++ b/contracts/IColony.sol @@ -449,10 +449,9 @@ contract IColony { /// @return Reputation root hash at the time of creation /// @return Total colony tokens at the time of creation /// @return Total amount of tokens taken aside for reward payout - /// @return Remaining (unclaimed) amount of tokens /// @return Token address /// @return Block number at the time of creation - function getRewardPayoutInfo(uint256 _payoutId) public view returns (bytes32, uint256, uint256, uint256, address, uint256); + function getRewardPayoutInfo(uint256 _payoutId) public view returns (bytes32, uint256, uint256, address, uint256); /// @notice Finalises the reward payout. Allows creation of next reward payouts for token that has been used in `_payoutId` /// Can only be called when reward payout cycle is finished i.e when 60 days have passed from its creation diff --git a/test/colony-funding.js b/test/colony-funding.js index 46e06392c1..397c09e3b9 100755 --- a/test/colony-funding.js +++ b/test/colony-funding.js @@ -3,7 +3,7 @@ import { toBN, sha3 } from "web3-utils"; import { MANAGER, EVALUATOR, WORKER, MANAGER_ROLE, EVALUATOR_ROLE, WORKER_ROLE, WORKER_PAYOUT, INITIAL_FUNDING } from "../helpers/constants"; -import { getTokenArgs, checkErrorRevert, web3GetBalance, forwardTime, bnSqrt } from "../helpers/test-helper"; +import { getTokenArgs, checkErrorRevert, web3GetBalance, forwardTime, currentBlockTime, bnSqrt } from "../helpers/test-helper"; import { fundColonyWithTokens, setupRatedTask, executeSignedTaskChange, executeSignedRoleAssignment, makeTask } from "../helpers/test-data-generator"; const EtherRouter = artifacts.require("EtherRouter"); @@ -1022,6 +1022,20 @@ contract("Colony Funding", addresses => { ); }); + it("should return correct info about reward payout", async () => { + const { logs } = await colony.startNextRewardPayout(otherToken.address); + const payoutId = logs[0].args.id; + + const balance = await colony.getPotBalance(0, otherToken.address); + const blockTimestamp = await currentBlockTime(); + + const info = await colony.getRewardPayoutInfo(payoutId); + assert.equal(info[1].toString(), userTokens.toString()); + assert.equal(info[2].toString(), balance.toString()); + assert.equal(info[3].toString(), otherToken.address); + assert.equal(info[4].toString(), blockTimestamp.toString()); + }); + const reputations = [ { totalReputation: toBN(3),