Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 10 additions & 1 deletion test/sol6/kyberDao.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,10 @@ contract('KyberDao', function(accounts) {

let link = web3.utils.fromAscii("https://kyberswap.com");
await updateCurrentBlockAndTimestamp();
let options = [1,2,3,4]
let txResult = await submitNewCampaign(kyberDao,
0, currentBlock + 2, currentBlock + 2 + minCampPeriod,
minPercentageInPrecision, cInPrecision, tInPrecision, [1, 2, 3, 4], link, {from: daoOperator}
minPercentageInPrecision, cInPrecision, tInPrecision, options, link, {from: daoOperator}
);
expectEvent(txResult, 'NewCampaignCreated', {
campaignType: new BN(0),
Expand All @@ -401,6 +402,14 @@ contract('KyberDao', function(accounts) {
tInPrecision: new BN(tInPrecision),
link: link
});
let eventLogs;
for (let i = 0; i < txResult.logs.length; i++) {
if (txResult.logs[i].event == 'NewCampaignCreated') {
eventLogs = txResult.logs[i];
break;
}
}
Helper.assertEqualArray(eventLogs.args.options, options);

await Helper.setNextBlockTimestamp(blockToTimestamp(currentBlock + 2));
// vote for first campaign
Expand Down
8 changes: 7 additions & 1 deletion test/sol6/kyberFeeHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,13 @@ contract('KyberFeeHandler', function(accounts) {
it("should have updated BRR if expiryTimestamp == 2 ** 64 - 1", async() => {
let maxExpiryTimestamp = new BN(2).pow(new BN(64)).sub(new BN(1));
await mockKyberDao.setMockEpochAndExpiryTimestamp(defaultEpoch, maxExpiryTimestamp);
await feeHandler.getBRR();
let txResult = await feeHandler.getBRR();
expectEvent(txResult, "BRRUpdated", {
rewardBps: rewardInBPS,
rebateBps: rebateInBPS,
epoch: epoch,
expiryTimestamp: maxExpiryTimestamp,
})
let result = await feeHandler.readBRRData();
Helper.assertEqual(result.expiryTimestamp, maxExpiryTimestamp, "expiry timestamp was not updated");
});
Expand Down
16 changes: 12 additions & 4 deletions test/sol6/withdrawableNoModifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let initialEtherBalance = new BN(10);
let etherWithdrawAmt = new BN(3);

const {zeroBN} = require("../helper.js");
const { expectRevert } = require('@openzeppelin/test-helpers');
const { expectRevert, expectEvent } = require('@openzeppelin/test-helpers');

contract('WithdrawableNoModifiers', function(accounts) {
before("should init globals, deploy test token", async function () {
Expand All @@ -37,7 +37,12 @@ contract('WithdrawableNoModifiers', function(accounts) {
Helper.assertEqual(admin, rxAdmin, "wrong admin " + rxAdmin.toString());

// withdraw the tokens from withdrawableInst
await withdrawableInst.withdrawToken(token.address, tokenWithdrawAmt, user, {from: admin});
let txResult = await withdrawableInst.withdrawToken(token.address, tokenWithdrawAmt, user, {from: admin});
expectEvent(txResult, "TokenWithdraw", {
token: token.address,
amount: tokenWithdrawAmt,
sendTo: user,
})

balance = await token.balanceOf(withdrawableInst.address);
Helper.assertEqual(balance, initialTokenBalance.sub(tokenWithdrawAmt), "unexpected balance in withdrawble contract.");
Expand Down Expand Up @@ -76,8 +81,11 @@ contract('WithdrawableNoModifiers', function(accounts) {

it("should test withdraw ether success for admin.", async function () {
// withdraw the ether from withdrawableInst
await withdrawableInst.withdrawEther(etherWithdrawAmt, user, {from: admin});

let txResult = await withdrawableInst.withdrawEther(etherWithdrawAmt, user, {from: admin});
expectEvent(txResult, "EtherWithdraw", {
amount: etherWithdrawAmt,
sendTo: user,
})
let balance = await Helper.getBalancePromise(withdrawableInst.address);
Helper.assertEqual(balance, initialEtherBalance.sub(etherWithdrawAmt), "unexpected balance in withdrawble contract.");
});
Expand Down