{ "stats": { "suites": 3, "tests": 16, "passes": 16, "pending": 0, "failures": 0, "start": "2017-11-10T21:21:29.936Z", "end": "2017-11-10T21:21:32.250Z", "duration": 2314, "testsRegistered": 16, "passPercent": 100, "pendingPercent": 0, "other": 0, "hasOther": false, "skipped": 0, "hasSkipped": false, "passPercentClass": "success", "pendingPercentClass": "danger" }, "suites": { "title": "", "suites": [ { "title": "PresaleOraclesMock", "suites": [], "tests": [], "pending": [], "root": false, "_timeout": 2000, "uuid": "4ba38039-cac6-4bcd-9082-f8bd3386a73e", "beforeHooks": [ { "title": "\"before all\" hook: prepare suite", "fullTitle": "PresaleOraclesMock \"before all\" hook: prepare suite", "timedOut": false, "duration": 0, "pass": false, "fail": false, "pending": false, "code": "series([\n runner.initialize.bind(runner),\n self.compileNewAbstractInterface.bind(this, runner),\n self.deployTestDependencies.bind(this, abstraction, dependency_paths, runner)\n], done);", "err": {}, "isRoot": false, "uuid": "1439ceda-5e1f-44dc-b001-b267079af36f", "parentUUID": "4ba38039-cac6-4bcd-9082-f8bd3386a73e", "isHook": true, "skipped": false }, { "title": "\"before each\" hook: before test", "fullTitle": "PresaleOraclesMock \"before each\" hook: before test", "timedOut": false, "duration": 0, "pass": false, "fail": false, "pending": false, "code": "runner.startTest(this, done);", "err": {}, "isRoot": false, "uuid": "913ca647-de04-4f1a-bdf5-3ad031bddd6e", "parentUUID": "4ba38039-cac6-4bcd-9082-f8bd3386a73e", "isHook": true, "skipped": false } ], "afterHooks": [ { "title": "\"after each\" hook: after test", "fullTitle": "PresaleOraclesMock \"after each\" hook: after test", "timedOut": false, "duration": 0, "pass": false, "fail": false, "pending": false, "code": "runner.endTest(this, done);", "err": {}, "isRoot": false, "uuid": "c8be5941-20fb-49b0-b10b-487e61e36dd8", "parentUUID": "4ba38039-cac6-4bcd-9082-f8bd3386a73e", "isHook": true, "skipped": false } ], "fullFile": "", "file": "", "passes": [], "failures": [], "skipped": [], "hasBeforeHooks": true, "hasAfterHooks": true, "hasTests": false, "hasSuites": false, "totalTests": 0, "totalPasses": 0, "totalFailures": 0, "totalPending": 0, "totalSkipped": 0, "hasPasses": false, "hasFailures": false, "hasPending": false, "hasSkipped": false, "duration": 0, "rootEmpty": false }, { "title": "Contract: Presale", "suites": [ { "title": "#initilize", "suites": [], "tests": [ { "title": "rejects if not sent by owner", "fullTitle": "Contract: Presale #initilize rejects if not sent by owner", "timedOut": false, "duration": 34, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "7867c68a-ba9d-4364-9815-7cbc2bdbb84c", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "sets values", "fullTitle": "Contract: Presale #initilize sets values", "timedOut": false, "duration": 146, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n true.should.be.equal(\n await presaleContract.isInitialized()\n )\n PRESALE_START_DATE.should.be.bignumber.equal(\n await presaleContract.startTime()\n )\n PRESALE_END_DATE.should.be.bignumber.equal(\n await presaleContract.endTime()\n )\n ETHER.mul(40000).should.be.bignumber.equal(\n await presaleContract.cap()\n )\n accounts[1].should.be.equal(\n await presaleContract.vault()\n )\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.minimumContribution()\n )", "err": {}, "isRoot": false, "uuid": "f7f63960-1046-4479-a13a-779400841bd4", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cannot initialize twice", "fullTitle": "Contract: Presale #initilize cannot initialize twice", "timedOut": false, "duration": 78, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // require(!isInitialized);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "eb678ae6-c761-423e-b72f-c64a1d87c4fe", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "startTime cannot be 0", "fullTitle": "Contract: Presale #initilize startTime cannot be 0", "timedOut": false, "duration": 26, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_startTime != 0);\n await presaleContract.initialize(0, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "cb41c43d-23c5-4fda-8be7-9c3da4ee74c7", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "endTime cannot be 0", "fullTitle": "Contract: Presale #initilize endTime cannot be 0", "timedOut": false, "duration": 24, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_endTime != 0);\n await presaleContract.initialize(PRESALE_START_DATE, 0, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "c6c544cd-713e-43be-a57c-05050bd18a49", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "endTime cannot be less than startTime", "fullTitle": "Contract: Presale #initilize endTime cannot be less than startTime", "timedOut": false, "duration": 19, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_endTime > _startTime);\n await presaleContract.initialize(PRESALE_END_DATE, PRESALE_START_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "0fdf76df-b21c-4d29-85f9-8d5dfe0127b0", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cap cannot be 0", "fullTitle": "Contract: Presale #initilize cap cannot be 0", "timedOut": false, "duration": 26, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_cap != 0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, 0, ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "5e03aa0d-340c-4771-b304-daf4b2f69dfd", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "vault cannot be 0x0", "fullTitle": "Contract: Presale #initilize vault cannot be 0x0", "timedOut": false, "duration": 21, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_vault != 0x0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), '0x0', {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "9258f606-112e-4fa8-9510-1bf4a5789142", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "minimumContribution cannot be 0", "fullTitle": "Contract: Presale #initilize minimumContribution cannot be 0", "timedOut": false, "duration": 29, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_vault != 0x0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), 0, accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "eb1df940-ac5c-483a-826b-25e5664a08d5", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false } ], "pending": [], "root": false, "_timeout": 300000, "file": "/test/presale.js", "uuid": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "beforeHooks": [ { "title": "\"before each\" hook", "fullTitle": "Contract: Presale #initilize \"before each\" hook", "timedOut": false, "duration": 1, "pass": false, "fail": false, "pending": false, "code": "PRESALE_START_DATE = moment('2017-12-11T16:00:00Z').unix();\nPRESALE_END_DATE = moment('2017-12-18T16:00:00Z').unix();", "err": {}, "isRoot": false, "uuid": "ea0bb2ca-f787-4d00-89a2-4f065d787d56", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": true, "skipped": false } ], "afterHooks": [], "fullFile": "/home/travis/build/rstormsf/oracles-presale/test/presale.js", "passes": [ { "title": "rejects if not sent by owner", "fullTitle": "Contract: Presale #initilize rejects if not sent by owner", "timedOut": false, "duration": 34, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "7867c68a-ba9d-4364-9815-7cbc2bdbb84c", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "sets values", "fullTitle": "Contract: Presale #initilize sets values", "timedOut": false, "duration": 146, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n true.should.be.equal(\n await presaleContract.isInitialized()\n )\n PRESALE_START_DATE.should.be.bignumber.equal(\n await presaleContract.startTime()\n )\n PRESALE_END_DATE.should.be.bignumber.equal(\n await presaleContract.endTime()\n )\n ETHER.mul(40000).should.be.bignumber.equal(\n await presaleContract.cap()\n )\n accounts[1].should.be.equal(\n await presaleContract.vault()\n )\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.minimumContribution()\n )", "err": {}, "isRoot": false, "uuid": "f7f63960-1046-4479-a13a-779400841bd4", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cannot initialize twice", "fullTitle": "Contract: Presale #initilize cannot initialize twice", "timedOut": false, "duration": 78, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // require(!isInitialized);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "eb678ae6-c761-423e-b72f-c64a1d87c4fe", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "startTime cannot be 0", "fullTitle": "Contract: Presale #initilize startTime cannot be 0", "timedOut": false, "duration": 26, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_startTime != 0);\n await presaleContract.initialize(0, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "cb41c43d-23c5-4fda-8be7-9c3da4ee74c7", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "endTime cannot be 0", "fullTitle": "Contract: Presale #initilize endTime cannot be 0", "timedOut": false, "duration": 24, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_endTime != 0);\n await presaleContract.initialize(PRESALE_START_DATE, 0, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "c6c544cd-713e-43be-a57c-05050bd18a49", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "endTime cannot be less than startTime", "fullTitle": "Contract: Presale #initilize endTime cannot be less than startTime", "timedOut": false, "duration": 19, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_endTime > _startTime);\n await presaleContract.initialize(PRESALE_END_DATE, PRESALE_START_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "0fdf76df-b21c-4d29-85f9-8d5dfe0127b0", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cap cannot be 0", "fullTitle": "Contract: Presale #initilize cap cannot be 0", "timedOut": false, "duration": 26, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_cap != 0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, 0, ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "5e03aa0d-340c-4771-b304-daf4b2f69dfd", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "vault cannot be 0x0", "fullTitle": "Contract: Presale #initilize vault cannot be 0x0", "timedOut": false, "duration": 21, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_vault != 0x0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), '0x0', {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "9258f606-112e-4fa8-9510-1bf4a5789142", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "minimumContribution cannot be 0", "fullTitle": "Contract: Presale #initilize minimumContribution cannot be 0", "timedOut": false, "duration": 29, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_vault != 0x0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), 0, accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "eb1df940-ac5c-483a-826b-25e5664a08d5", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false } ], "failures": [], "skipped": [], "hasBeforeHooks": true, "hasAfterHooks": false, "hasTests": true, "hasSuites": false, "totalTests": 9, "totalPasses": 9, "totalFailures": 0, "totalPending": 0, "totalSkipped": 0, "hasPasses": true, "hasFailures": false, "hasPending": false, "hasSkipped": false, "duration": 403, "rootEmpty": false }, { "title": "#buy", "suites": [], "tests": [ { "title": "cannot buy if not value is 0", "fullTitle": "Contract: Presale #buy cannot buy if not value is 0", "timedOut": false, "duration": 36, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(msg.value > 0);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: 0})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "682d191b-a8f2-4c0a-8442-876765d65de5", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "cannot buy if not value is less than minimum", "fullTitle": "Contract: Presale #buy cannot buy if not value is less than minimum", "timedOut": false, "duration": 39, "state": "passed", "speed": "medium", "pass": true, "fail": false, "pending": false, "code": "async \n // require(msg.value > 0);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(99)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "1284de67-1a66-4f2a-8bb6-e299d06b3730", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "can not buy if time is not within startTime&endTime", "fullTitle": "Contract: Presale #buy can not buy if time is not within startTime&endTime", "timedOut": false, "duration": 82, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // require(now >= startTime && now <= endTime);\n await presaleContract.setTime(PRESALE_START_DATE - 1);\n await presaleContract.sendTransaction({value: ETHER.mul(100)})\n .should.be.rejectedWith(REVERT_MSG);\n await presaleContract.setTime(PRESALE_END_DATE + 1);\n await presaleContract.sendTransaction({value: ETHER.mul(100)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "2094e757-c314-4df8-8de4-a22f319d0a32", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "can not buy more than cap", "fullTitle": "Contract: Presale #buy can not buy more than cap", "timedOut": false, "duration": 40, "state": "passed", "speed": "medium", "pass": true, "fail": false, "pending": false, "code": "async \n // bool withinCap = totalInvestedInWei.add(msg.value) <= cap;\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(40000).add(1)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "27ce0d8b-659c-4789-a6f5-7c2a00edfb85", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "happy path", "fullTitle": "Contract: Presale #buy happy path", "timedOut": false, "duration": 580, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // investorBalances[investor] += msg.value;\n // totalInvestedInWei += msg.value;\n // forwardFunds(msg.value);\n const vault = accounts[1];\n const preVaultBalance = await web3.eth.getBalance(vault);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(100)});\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.investorBalances(accounts[0])\n )\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.totalInvestedInWei()\n )\n preVaultBalance.add(ETHER.mul(100)).should.be.bignumber.equal(\n await web3.eth.getBalance(vault)\n )\n await presaleContract.sendTransaction({value: ETHER.mul(2)});\n ETHER.mul(100).add(ETHER.mul(2)).should.be.bignumber.equal(\n await presaleContract.investorBalances(accounts[0])\n )\n ETHER.mul(100).add(ETHER.mul(2)).should.be.bignumber.equal(\n await presaleContract.totalInvestedInWei()\n )\n preVaultBalance.add(ETHER.mul(100).add(ETHER.mul(2))).should.be.bignumber.equal(\n await web3.eth.getBalance(vault)\n )\n await presaleContract.sendTransaction({value: ETHER.mul(40000-100-2).add(1)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "a028f084-2f7c-4086-8f2d-8d2e155e7f5f", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false } ], "pending": [], "root": false, "_timeout": 300000, "file": "/test/presale.js", "uuid": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "beforeHooks": [ { "title": "\"before each\" hook", "fullTitle": "Contract: Presale #buy \"before each\" hook", "timedOut": false, "duration": 37, "pass": false, "fail": false, "pending": false, "code": "async \n PRESALE_START_DATE = moment('2017-12-11T16:00:00Z').unix();\n PRESALE_END_DATE = moment('2017-12-18T16:00:00Z').unix();\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})", "err": {}, "isRoot": false, "uuid": "bdbf477a-a07f-4400-8cfc-8d7d4212ec68", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": true, "skipped": false } ], "afterHooks": [], "fullFile": "/home/travis/build/rstormsf/oracles-presale/test/presale.js", "passes": [ { "title": "cannot buy if not value is 0", "fullTitle": "Contract: Presale #buy cannot buy if not value is 0", "timedOut": false, "duration": 36, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(msg.value > 0);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: 0})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "682d191b-a8f2-4c0a-8442-876765d65de5", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "cannot buy if not value is less than minimum", "fullTitle": "Contract: Presale #buy cannot buy if not value is less than minimum", "timedOut": false, "duration": 39, "state": "passed", "speed": "medium", "pass": true, "fail": false, "pending": false, "code": "async \n // require(msg.value > 0);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(99)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "1284de67-1a66-4f2a-8bb6-e299d06b3730", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "can not buy if time is not within startTime&endTime", "fullTitle": "Contract: Presale #buy can not buy if time is not within startTime&endTime", "timedOut": false, "duration": 82, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // require(now >= startTime && now <= endTime);\n await presaleContract.setTime(PRESALE_START_DATE - 1);\n await presaleContract.sendTransaction({value: ETHER.mul(100)})\n .should.be.rejectedWith(REVERT_MSG);\n await presaleContract.setTime(PRESALE_END_DATE + 1);\n await presaleContract.sendTransaction({value: ETHER.mul(100)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "2094e757-c314-4df8-8de4-a22f319d0a32", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "can not buy more than cap", "fullTitle": "Contract: Presale #buy can not buy more than cap", "timedOut": false, "duration": 40, "state": "passed", "speed": "medium", "pass": true, "fail": false, "pending": false, "code": "async \n // bool withinCap = totalInvestedInWei.add(msg.value) <= cap;\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(40000).add(1)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "27ce0d8b-659c-4789-a6f5-7c2a00edfb85", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "happy path", "fullTitle": "Contract: Presale #buy happy path", "timedOut": false, "duration": 580, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // investorBalances[investor] += msg.value;\n // totalInvestedInWei += msg.value;\n // forwardFunds(msg.value);\n const vault = accounts[1];\n const preVaultBalance = await web3.eth.getBalance(vault);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(100)});\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.investorBalances(accounts[0])\n )\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.totalInvestedInWei()\n )\n preVaultBalance.add(ETHER.mul(100)).should.be.bignumber.equal(\n await web3.eth.getBalance(vault)\n )\n await presaleContract.sendTransaction({value: ETHER.mul(2)});\n ETHER.mul(100).add(ETHER.mul(2)).should.be.bignumber.equal(\n await presaleContract.investorBalances(accounts[0])\n )\n ETHER.mul(100).add(ETHER.mul(2)).should.be.bignumber.equal(\n await presaleContract.totalInvestedInWei()\n )\n preVaultBalance.add(ETHER.mul(100).add(ETHER.mul(2))).should.be.bignumber.equal(\n await web3.eth.getBalance(vault)\n )\n await presaleContract.sendTransaction({value: ETHER.mul(40000-100-2).add(1)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "a028f084-2f7c-4086-8f2d-8d2e155e7f5f", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false } ], "failures": [], "skipped": [], "hasBeforeHooks": true, "hasAfterHooks": false, "hasTests": true, "hasSuites": false, "totalTests": 5, "totalPasses": 5, "totalFailures": 0, "totalPending": 0, "totalSkipped": 0, "hasPasses": true, "hasFailures": false, "hasPending": false, "hasSkipped": false, "duration": 777, "rootEmpty": false } ], "tests": [ { "title": "constructor should set owner", "fullTitle": "Contract: Presale constructor should set owner", "timedOut": false, "duration": 28, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n accounts[0].should.be.equal(\n await presaleContract.owner()\n );", "err": {}, "isRoot": false, "uuid": "168e6c12-1e8a-4193-bf41-5634bb02d30d", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": false, "skipped": false }, { "title": "can not buy if not initialized", "fullTitle": "Contract: Presale can not buy if not initialized", "timedOut": false, "duration": 36, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.sendTransaction({amount: ETHER})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "122f70d2-671d-483b-9475-cdab8a973d3f", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": false, "skipped": false } ], "pending": [], "root": false, "_timeout": 300000, "file": "/test/presale.js", "uuid": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "beforeHooks": [ { "title": "\"before all\" hook: prepare suite", "fullTitle": "Contract: Presale \"before all\" hook: prepare suite", "timedOut": false, "duration": 20, "pass": false, "fail": false, "pending": false, "code": "this.timeout(runner.BEFORE_TIMEOUT);\nrunner.initialize(done);", "err": {}, "isRoot": false, "uuid": "4bf4f1d3-800c-4984-a66d-2030f7403bd0", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": true, "skipped": false }, { "title": "\"before each\" hook: before test", "fullTitle": "Contract: Presale \"before each\" hook: before test", "timedOut": false, "duration": 3, "pass": false, "fail": false, "pending": false, "code": "runner.startTest(this, done);", "err": {}, "isRoot": false, "uuid": "874d7712-89d0-4c05-913d-ca4b58d4557c", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": true, "skipped": false }, { "title": "\"before each\" hook", "fullTitle": "Contract: Presale \"before each\" hook", "timedOut": false, "duration": 53, "pass": false, "fail": false, "pending": false, "code": "async \n presaleContract = await PresaleOracles.new();", "err": {}, "isRoot": false, "uuid": "4999ab0a-1024-48f1-a6e8-a548de02e295", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": true, "skipped": false } ], "afterHooks": [ { "title": "\"after each\" hook: after test", "fullTitle": "Contract: Presale \"after each\" hook: after test", "timedOut": false, "duration": 0, "pass": false, "fail": false, "pending": false, "code": "runner.endTest(this, done);", "err": {}, "isRoot": false, "uuid": "52a6f97a-557a-438d-83e6-f9b2b314cee8", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": true, "skipped": false } ], "fullFile": "/home/travis/build/rstormsf/oracles-presale/test/presale.js", "passes": [ { "title": "constructor should set owner", "fullTitle": "Contract: Presale constructor should set owner", "timedOut": false, "duration": 28, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n accounts[0].should.be.equal(\n await presaleContract.owner()\n );", "err": {}, "isRoot": false, "uuid": "168e6c12-1e8a-4193-bf41-5634bb02d30d", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": false, "skipped": false }, { "title": "can not buy if not initialized", "fullTitle": "Contract: Presale can not buy if not initialized", "timedOut": false, "duration": 36, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.sendTransaction({amount: ETHER})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "122f70d2-671d-483b-9475-cdab8a973d3f", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": false, "skipped": false } ], "failures": [], "skipped": [], "hasBeforeHooks": true, "hasAfterHooks": true, "hasTests": true, "hasSuites": true, "totalTests": 2, "totalPasses": 2, "totalFailures": 0, "totalPending": 0, "totalSkipped": 0, "hasPasses": true, "hasFailures": false, "hasPending": false, "hasSkipped": false, "duration": 64, "rootEmpty": false } ], "tests": [], "pending": [], "root": true, "_timeout": 2000, "uuid": "fcd9c9a0-4184-4634-bb1f-74b3a6cb71df", "beforeHooks": [], "afterHooks": [], "fullFile": "", "file": "", "passes": [], "failures": [], "skipped": [], "hasBeforeHooks": false, "hasAfterHooks": false, "hasTests": false, "hasSuites": true, "totalTests": 0, "totalPasses": 0, "totalFailures": 0, "totalPending": 0, "totalSkipped": 0, "hasPasses": false, "hasFailures": false, "hasPending": false, "hasSkipped": false, "duration": 0, "rootEmpty": true }, "allTests": [ { "title": "constructor should set owner", "fullTitle": "Contract: Presale constructor should set owner", "timedOut": false, "duration": 28, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n accounts[0].should.be.equal(\n await presaleContract.owner()\n );", "err": {}, "isRoot": false, "uuid": "168e6c12-1e8a-4193-bf41-5634bb02d30d", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": false, "skipped": false }, { "title": "can not buy if not initialized", "fullTitle": "Contract: Presale can not buy if not initialized", "timedOut": false, "duration": 36, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.sendTransaction({amount: ETHER})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "122f70d2-671d-483b-9475-cdab8a973d3f", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": false, "skipped": false }, { "title": "rejects if not sent by owner", "fullTitle": "#initilize rejects if not sent by owner", "timedOut": false, "duration": 34, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "7867c68a-ba9d-4364-9815-7cbc2bdbb84c", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "sets values", "fullTitle": "#initilize sets values", "timedOut": false, "duration": 146, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n true.should.be.equal(\n await presaleContract.isInitialized()\n )\n PRESALE_START_DATE.should.be.bignumber.equal(\n await presaleContract.startTime()\n )\n PRESALE_END_DATE.should.be.bignumber.equal(\n await presaleContract.endTime()\n )\n ETHER.mul(40000).should.be.bignumber.equal(\n await presaleContract.cap()\n )\n accounts[1].should.be.equal(\n await presaleContract.vault()\n )\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.minimumContribution()\n )", "err": {}, "isRoot": false, "uuid": "f7f63960-1046-4479-a13a-779400841bd4", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cannot initialize twice", "fullTitle": "#initilize cannot initialize twice", "timedOut": false, "duration": 78, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // require(!isInitialized);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "eb678ae6-c761-423e-b72f-c64a1d87c4fe", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "startTime cannot be 0", "fullTitle": "#initilize startTime cannot be 0", "timedOut": false, "duration": 26, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_startTime != 0);\n await presaleContract.initialize(0, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "cb41c43d-23c5-4fda-8be7-9c3da4ee74c7", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "endTime cannot be 0", "fullTitle": "#initilize endTime cannot be 0", "timedOut": false, "duration": 24, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_endTime != 0);\n await presaleContract.initialize(PRESALE_START_DATE, 0, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "c6c544cd-713e-43be-a57c-05050bd18a49", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "endTime cannot be less than startTime", "fullTitle": "#initilize endTime cannot be less than startTime", "timedOut": false, "duration": 19, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_endTime > _startTime);\n await presaleContract.initialize(PRESALE_END_DATE, PRESALE_START_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "0fdf76df-b21c-4d29-85f9-8d5dfe0127b0", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cap cannot be 0", "fullTitle": "#initilize cap cannot be 0", "timedOut": false, "duration": 26, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_cap != 0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, 0, ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "5e03aa0d-340c-4771-b304-daf4b2f69dfd", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "vault cannot be 0x0", "fullTitle": "#initilize vault cannot be 0x0", "timedOut": false, "duration": 21, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_vault != 0x0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), '0x0', {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "9258f606-112e-4fa8-9510-1bf4a5789142", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "minimumContribution cannot be 0", "fullTitle": "#initilize minimumContribution cannot be 0", "timedOut": false, "duration": 29, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_vault != 0x0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), 0, accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "eb1df940-ac5c-483a-826b-25e5664a08d5", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cannot buy if not value is 0", "fullTitle": "#buy cannot buy if not value is 0", "timedOut": false, "duration": 36, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(msg.value > 0);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: 0})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "682d191b-a8f2-4c0a-8442-876765d65de5", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "cannot buy if not value is less than minimum", "fullTitle": "#buy cannot buy if not value is less than minimum", "timedOut": false, "duration": 39, "state": "passed", "speed": "medium", "pass": true, "fail": false, "pending": false, "code": "async \n // require(msg.value > 0);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(99)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "1284de67-1a66-4f2a-8bb6-e299d06b3730", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "can not buy if time is not within startTime&endTime", "fullTitle": "#buy can not buy if time is not within startTime&endTime", "timedOut": false, "duration": 82, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // require(now >= startTime && now <= endTime);\n await presaleContract.setTime(PRESALE_START_DATE - 1);\n await presaleContract.sendTransaction({value: ETHER.mul(100)})\n .should.be.rejectedWith(REVERT_MSG);\n await presaleContract.setTime(PRESALE_END_DATE + 1);\n await presaleContract.sendTransaction({value: ETHER.mul(100)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "2094e757-c314-4df8-8de4-a22f319d0a32", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "can not buy more than cap", "fullTitle": "#buy can not buy more than cap", "timedOut": false, "duration": 40, "state": "passed", "speed": "medium", "pass": true, "fail": false, "pending": false, "code": "async \n // bool withinCap = totalInvestedInWei.add(msg.value) <= cap;\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(40000).add(1)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "27ce0d8b-659c-4789-a6f5-7c2a00edfb85", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "happy path", "fullTitle": "#buy happy path", "timedOut": false, "duration": 580, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // investorBalances[investor] += msg.value;\n // totalInvestedInWei += msg.value;\n // forwardFunds(msg.value);\n const vault = accounts[1];\n const preVaultBalance = await web3.eth.getBalance(vault);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(100)});\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.investorBalances(accounts[0])\n )\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.totalInvestedInWei()\n )\n preVaultBalance.add(ETHER.mul(100)).should.be.bignumber.equal(\n await web3.eth.getBalance(vault)\n )\n await presaleContract.sendTransaction({value: ETHER.mul(2)});\n ETHER.mul(100).add(ETHER.mul(2)).should.be.bignumber.equal(\n await presaleContract.investorBalances(accounts[0])\n )\n ETHER.mul(100).add(ETHER.mul(2)).should.be.bignumber.equal(\n await presaleContract.totalInvestedInWei()\n )\n preVaultBalance.add(ETHER.mul(100).add(ETHER.mul(2))).should.be.bignumber.equal(\n await web3.eth.getBalance(vault)\n )\n await presaleContract.sendTransaction({value: ETHER.mul(40000-100-2).add(1)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "a028f084-2f7c-4086-8f2d-8d2e155e7f5f", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false } ], "allPending": [], "allPasses": [ { "title": "constructor should set owner", "fullTitle": "Contract: Presale constructor should set owner", "timedOut": false, "duration": 28, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n accounts[0].should.be.equal(\n await presaleContract.owner()\n );", "err": {}, "isRoot": false, "uuid": "168e6c12-1e8a-4193-bf41-5634bb02d30d", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": false, "skipped": false }, { "title": "can not buy if not initialized", "fullTitle": "Contract: Presale can not buy if not initialized", "timedOut": false, "duration": 36, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.sendTransaction({amount: ETHER})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "122f70d2-671d-483b-9475-cdab8a973d3f", "parentUUID": "0a2166d5-46d4-4d61-ab9d-cff540ced2a9", "isHook": false, "skipped": false }, { "title": "rejects if not sent by owner", "fullTitle": "#initilize rejects if not sent by owner", "timedOut": false, "duration": 34, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "7867c68a-ba9d-4364-9815-7cbc2bdbb84c", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "sets values", "fullTitle": "#initilize sets values", "timedOut": false, "duration": 146, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n true.should.be.equal(\n await presaleContract.isInitialized()\n )\n PRESALE_START_DATE.should.be.bignumber.equal(\n await presaleContract.startTime()\n )\n PRESALE_END_DATE.should.be.bignumber.equal(\n await presaleContract.endTime()\n )\n ETHER.mul(40000).should.be.bignumber.equal(\n await presaleContract.cap()\n )\n accounts[1].should.be.equal(\n await presaleContract.vault()\n )\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.minimumContribution()\n )", "err": {}, "isRoot": false, "uuid": "f7f63960-1046-4479-a13a-779400841bd4", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cannot initialize twice", "fullTitle": "#initilize cannot initialize twice", "timedOut": false, "duration": 78, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // require(!isInitialized);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[0]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "eb678ae6-c761-423e-b72f-c64a1d87c4fe", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "startTime cannot be 0", "fullTitle": "#initilize startTime cannot be 0", "timedOut": false, "duration": 26, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_startTime != 0);\n await presaleContract.initialize(0, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "cb41c43d-23c5-4fda-8be7-9c3da4ee74c7", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "endTime cannot be 0", "fullTitle": "#initilize endTime cannot be 0", "timedOut": false, "duration": 24, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_endTime != 0);\n await presaleContract.initialize(PRESALE_START_DATE, 0, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "c6c544cd-713e-43be-a57c-05050bd18a49", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "endTime cannot be less than startTime", "fullTitle": "#initilize endTime cannot be less than startTime", "timedOut": false, "duration": 19, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_endTime > _startTime);\n await presaleContract.initialize(PRESALE_END_DATE, PRESALE_START_DATE, ETHER.mul(40000), ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "0fdf76df-b21c-4d29-85f9-8d5dfe0127b0", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cap cannot be 0", "fullTitle": "#initilize cap cannot be 0", "timedOut": false, "duration": 26, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_cap != 0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, 0, ETHER.mul(100), accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "5e03aa0d-340c-4771-b304-daf4b2f69dfd", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "vault cannot be 0x0", "fullTitle": "#initilize vault cannot be 0x0", "timedOut": false, "duration": 21, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_vault != 0x0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), ETHER.mul(100), '0x0', {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "9258f606-112e-4fa8-9510-1bf4a5789142", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "minimumContribution cannot be 0", "fullTitle": "#initilize minimumContribution cannot be 0", "timedOut": false, "duration": 29, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(_vault != 0x0);\n await presaleContract.initialize(PRESALE_START_DATE, PRESALE_END_DATE, ETHER.mul(40000), 0, accounts[1], {from: accounts[1]})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "eb1df940-ac5c-483a-826b-25e5664a08d5", "parentUUID": "9e97f0b6-5320-4a1d-a3e0-c594e35f84e9", "isHook": false, "skipped": false }, { "title": "cannot buy if not value is 0", "fullTitle": "#buy cannot buy if not value is 0", "timedOut": false, "duration": 36, "state": "passed", "speed": "fast", "pass": true, "fail": false, "pending": false, "code": "async \n // require(msg.value > 0);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: 0})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "682d191b-a8f2-4c0a-8442-876765d65de5", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "cannot buy if not value is less than minimum", "fullTitle": "#buy cannot buy if not value is less than minimum", "timedOut": false, "duration": 39, "state": "passed", "speed": "medium", "pass": true, "fail": false, "pending": false, "code": "async \n // require(msg.value > 0);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(99)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "1284de67-1a66-4f2a-8bb6-e299d06b3730", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "can not buy if time is not within startTime&endTime", "fullTitle": "#buy can not buy if time is not within startTime&endTime", "timedOut": false, "duration": 82, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // require(now >= startTime && now <= endTime);\n await presaleContract.setTime(PRESALE_START_DATE - 1);\n await presaleContract.sendTransaction({value: ETHER.mul(100)})\n .should.be.rejectedWith(REVERT_MSG);\n await presaleContract.setTime(PRESALE_END_DATE + 1);\n await presaleContract.sendTransaction({value: ETHER.mul(100)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "2094e757-c314-4df8-8de4-a22f319d0a32", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "can not buy more than cap", "fullTitle": "#buy can not buy more than cap", "timedOut": false, "duration": 40, "state": "passed", "speed": "medium", "pass": true, "fail": false, "pending": false, "code": "async \n // bool withinCap = totalInvestedInWei.add(msg.value) <= cap;\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(40000).add(1)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "27ce0d8b-659c-4789-a6f5-7c2a00edfb85", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false }, { "title": "happy path", "fullTitle": "#buy happy path", "timedOut": false, "duration": 580, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "code": "async \n // investorBalances[investor] += msg.value;\n // totalInvestedInWei += msg.value;\n // forwardFunds(msg.value);\n const vault = accounts[1];\n const preVaultBalance = await web3.eth.getBalance(vault);\n await presaleContract.setTime(PRESALE_START_DATE);\n await presaleContract.sendTransaction({value: ETHER.mul(100)});\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.investorBalances(accounts[0])\n )\n ETHER.mul(100).should.be.bignumber.equal(\n await presaleContract.totalInvestedInWei()\n )\n preVaultBalance.add(ETHER.mul(100)).should.be.bignumber.equal(\n await web3.eth.getBalance(vault)\n )\n await presaleContract.sendTransaction({value: ETHER.mul(2)});\n ETHER.mul(100).add(ETHER.mul(2)).should.be.bignumber.equal(\n await presaleContract.investorBalances(accounts[0])\n )\n ETHER.mul(100).add(ETHER.mul(2)).should.be.bignumber.equal(\n await presaleContract.totalInvestedInWei()\n )\n preVaultBalance.add(ETHER.mul(100).add(ETHER.mul(2))).should.be.bignumber.equal(\n await web3.eth.getBalance(vault)\n )\n await presaleContract.sendTransaction({value: ETHER.mul(40000-100-2).add(1)})\n .should.be.rejectedWith(REVERT_MSG);", "err": {}, "isRoot": false, "uuid": "a028f084-2f7c-4086-8f2d-8d2e155e7f5f", "parentUUID": "a46becbb-5ad3-4f4d-8ff4-b3b9b960d4c5", "isHook": false, "skipped": false } ], "allFailures": [], "copyrightYear": 2017 }