@giveth/commons-abc-contracts
Advanced tools
Comparing version 0.1.14 to 0.1.15
{ | ||
"name": "@giveth/commons-abc-contracts", | ||
"version": "0.1.14", | ||
"version": "0.1.15", | ||
"devDependencies": { | ||
@@ -5,0 +5,0 @@ "chai": "^4.2.0", |
const { BN, constants, expectEvent, shouldFail } = require('openzeppelin-test-helpers'); | ||
const CommonsToken = artifacts.require("CommonsToken.sol"); | ||
@@ -9,2 +8,3 @@ const FundingPoolMock = artifacts.require("FundingPoolMock.sol"); | ||
const DENOMINATOR_PPM = 1000000; | ||
contract("CommonsToken", ([reserveTokenMinter, contractCreator, hatcherOne, hatcherTwo, lateInvestor]) => { | ||
@@ -118,4 +118,4 @@ const reserveRatio = 142857; // kappa ~ 6 | ||
it("Should have minted the correct amount to the fundingPool", async function() { | ||
let internalTokensInFundingPool = await this.commonsToken.balanceOf(this.fundingPool.address) | ||
assert.equal(internalTokensInFundingPool, (initialRaise / p0 ) * (theta / DENOMINATOR_PPM)); | ||
let internalTokensInFundingPool = await this.commonsToken.balanceOf(this.fundingPool.address); | ||
assert.equal(internalTokensInFundingPool, (initialRaise / p0) * (theta / DENOMINATOR_PPM)); | ||
}) | ||
@@ -125,7 +125,7 @@ | ||
let internalTokensReserve = await this.commonsToken.balanceOf(this.commonsToken.address); | ||
assert.equal(internalTokensInFundingPool, (initialRaise / p0 ) * (1 - (theta / DENOMINATOR_PPM))); | ||
assert.equal(internalTokensReserve, (initialRaise / p0) * (1 - (theta / DENOMINATOR_PPM))); | ||
}) | ||
it("Should have ended the hatching phase", async function() { | ||
let isHatched = await this.isHatched(); | ||
let isHatched = await this.commonsToken.isHatched(); | ||
assert.isTrue(isHatched); | ||
@@ -142,3 +142,2 @@ }) | ||
beforeEach(async function() { | ||
// problem. The msg.sender is the smart contract. | ||
await this.reserveToken.approve(this.commonsToken.address, amountToFundExtern, {from: hatcherOne}); | ||
@@ -148,2 +147,4 @@ await this.commonsToken.hatchContribute(amountToFundExtern, {from: hatcherOne}); | ||
it('reverts', async function() { | ||
let isHatched = await this.commonsToken.isHatched(); | ||
assert.isTrue(isHatched); | ||
await shouldFail.reverting(this.commonsToken.hatchContribute(amountToFundExtern, {from: hatcherOne})) | ||
@@ -169,7 +170,19 @@ }) | ||
describe("When the sender is not the fundingPool", function() { | ||
//reverts | ||
it("reverts", async function() { | ||
await shouldFail.reverting(this.commonsToken.fundsAllocated(3000)); | ||
}); | ||
}) | ||
}) | ||
describe("claimFunds", function() { | ||
describe("when we are claiming tokens", function() { | ||
describe("when we have remaining locked tokens", function() { | ||
// receive internal tokens in our balance | ||
}); | ||
describe("when we do not have any more locked tokens", function() { | ||
// reverts | ||
}); | ||
}); | ||
}); | ||
describe("burn", function() { | ||
@@ -183,8 +196,8 @@ describe("When we are not in the hatching phase", function() { | ||
describe("When the callee has not enough internal tokens", function() { | ||
//revert | ||
// revert | ||
}) | ||
}) | ||
describe("When we are in the hatchin phase", function() { | ||
//reverts | ||
describe("When we are in the hatching phase", function() { | ||
// reverts | ||
}) | ||
@@ -196,6 +209,5 @@ }) | ||
}) | ||
describe("When we are in the hatching phase", function() { | ||
// reverts | ||
}) | ||
@@ -202,0 +214,0 @@ }) |
Sorry, the diff of this file is not supported yet
348229
293