Skip to content

Commit

Permalink
Fix for unit-tests, add missing operatorData param to interface, add …
Browse files Browse the repository at this point in the history
…missing mocks for Sweep
  • Loading branch information
robsecord committed Jun 23, 2020
1 parent 60f5378 commit 0e4570b
Show file tree
Hide file tree
Showing 3 changed files with 210 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface PeriodicPrizePoolInterface is YieldServiceInterface {
function prizePeriodRemainingSeconds() external view returns (uint256);
function prizePeriodStartedAt() external view returns (uint256);
function prizePeriodEndAt() external view returns (uint256);
function mintTickets(address to, uint256 amount, bytes calldata data) external;
function mintTickets(address to, uint256 amount, bytes calldata data, bytes calldata operatorData) external;
function ticket() external view returns (TicketInterface);
function isPrizePeriodOver() external view returns (bool);
function calculateExitFee(uint256 tickets, uint256 ticketInterestRatioMantissa) external view returns (uint256);
Expand Down
4 changes: 4 additions & 0 deletions test/PeriodicPrizePool.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,11 @@ describe('PeriodicPrizePool contract', function() {
for await (let user of iterableAccounts()) {
const amount = amounts[user.index]
await cToken.mock.redeemUnderlying.withArgs(amount).returns(amount)
await token.mock.transfer.withArgs(user.data._address, amount).returns(true)
await sponsorship.mock.balanceOf.withArgs(user.data._address).returns(amount)

await sponsorship.mock.controllerBurn.withArgs(user.data._address, amount, EMPTY_STR, EMPTY_STR).returns()
await sponsorshipCredit.mock.controllerMint.withArgs(user.data._address, interestAmount, EMPTY_STR, EMPTY_STR).returns()
}

// Sweep for multiple accounts
Expand Down
Loading

0 comments on commit 0e4570b

Please sign in to comment.