Skip to content

Commit fd9576f

Browse files
committed
skip TGEDeployer test
1 parent 4cf80aa commit fd9576f

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

test/CrowdsaleGenTest.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,9 @@ contract('LifCrowdsale Property-based test', function (accounts) {
3737
let tokensInPurchases = sumBigNumbers(_.map(state.purchases, (p) => p.tokens));
3838
tokensInPurchases.should.be.bignumber.equal(help.lifWei2Lif(await crowdsale.tokensSold()));
3939

40-
let presaleWei = sumBigNumbers(_.map(state.presalePurchases, (p) => p.wei));
41-
4240
help.debug('checking purchases total wei, purchases:', JSON.stringify(state.purchases));
4341
let weiInPurchases = sumBigNumbers(_.map(state.purchases, (p) => p.wei));
44-
if (state.crowdsaleFinalized)
45-
new BigNumber(0).should.be.bignumber.equal(await web3.eth.getBalance(crowdsale.address));
46-
else
47-
weiInPurchases.should.be.bignumber.equal(await web3.eth.getBalance(crowdsale.address));
42+
if (state.crowdsaleFinalized) { new BigNumber(0).should.be.bignumber.equal(await web3.eth.getBalance(crowdsale.address)); } else { weiInPurchases.should.be.bignumber.equal(await web3.eth.getBalance(crowdsale.address)); }
4843

4944
// Check presale tokens sold
5045
assert.equal(state.crowdsaleFinalized, await crowdsale.isFinalized.call());

test/deploy/TGEDeployer.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ const _ = require('lodash');
1616
const TGEDistribution = require('./TGEDistribution');
1717

1818
contract('TGE Deployer', function ([deployAddress, foundationWallet, foundersWallet]) {
19-
it.only('Deploy a TGE correctly', async function () {
20-
const startTimestamp = new Date('Sun, 28 Jan 2018 15:00:00 GMT-3').getTime() / 1000;
21-
const end1Timestamp = new Date('Sun, 28 Jan 2018 24:00:00 GMT-3').getTime() / 1000;
22-
const end2Timestamp = new Date('Mon, 29 Jan 2018 12:00:00 GMT-3').getTime() / 1000;
19+
it.skip('Deploy a TGE correctly', async function () {
20+
const startTimestamp = new Date('28 Jan 2019 15:00:00 GMT-3').getTime() / 1000;
21+
const end1Timestamp = new Date('28 Jan 2019 24:00:00 GMT-3').getTime() / 1000;
22+
const end2Timestamp = new Date('29 Jan 2019 12:00:00 GMT-3').getTime() / 1000;
2323
const rate1 = 1000;
2424
const rate2 = 900;
2525
const setWeiLockSeconds = duration.minutes(30);
2626
var totalSupply = new BigNumber(0);
27-
const weiPerUSDinTGE = web3.toWei(1 / 1000);
27+
var ETHRaised = new BigNumber(0);
28+
const USDperETH = 100000000;
29+
const weiPerUSDinTGE = web3.toWei(1 / USDperETH);
2830

2931
const deployer = await TGEDeployer.new(
3032
startTimestamp, end1Timestamp, end2Timestamp, rate1,
@@ -36,7 +38,7 @@ contract('TGE Deployer', function ([deployAddress, foundationWallet, foundersWal
3638
const token = LifToken.at(await crowdsale.token());
3739

3840
help.debug('Data to create Deployer contract:');
39-
help.debug(deployer.deployedBytecode);
41+
help.debug(web3.eth.getTransaction(deployer.contract.transactionHash).input);
4042
help.debug('--------------------------------------------------');
4143

4244
// Check values
@@ -55,6 +57,8 @@ contract('TGE Deployer', function ([deployAddress, foundationWallet, foundersWal
5557

5658
// Parse ETH to wei
5759
stage.values.map(function (value, i) {
60+
stage.values[i] = new BigNumber(stage.values[i]);
61+
ETHRaised = ETHRaised.add(stage.values[i]);
5862
stageETH = stageETH.add(stage.values[i]);
5963
stage.values[i] = web3.toWei(stage.values[i]);
6064
});
@@ -101,6 +105,18 @@ contract('TGE Deployer', function ([deployAddress, foundationWallet, foundersWal
101105
assert.equal(foundationWallet, parseInt(await crowdsale.owner.call()));
102106
assert.equal(weiPerUSDinTGE, parseInt(await crowdsale.weiPerUSDinTGE.call()));
103107

108+
const USDRaised = ETHRaised * USDperETH;
109+
console.log('USD raised', USDRaised);
110+
console.log('Funded', await crowdsale.funded());
111+
112+
// Check USD raised
113+
new BigNumber(USDRaised).should.be.bignumber
114+
.equal((await crowdsale.weiRaised()).div(weiPerUSDinTGE), 2);
115+
116+
// Check ETH raised
117+
ETHRaised.should.be.bignumber
118+
.equal(web3.fromWei(await crowdsale.weiRaised()), 2);
119+
104120
// Check final total supply
105121
totalSupply.should.be.bignumber
106122
.equal(help.lifWei2Lif(await token.totalSupply()), 2);

0 commit comments

Comments
 (0)