From df786d1536cd14e304b5a526e3e1dd8912ff4293 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Tue, 26 Jun 2018 17:02:04 -0400 Subject: [PATCH] Removing start block --- contracts/polls/PollManager.sol | 7 +++---- test/votingdapp.js | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/contracts/polls/PollManager.sol b/contracts/polls/PollManager.sol index 2c1bf60..7204157 100644 --- a/contracts/polls/PollManager.sol +++ b/contracts/polls/PollManager.sol @@ -53,19 +53,18 @@ contract PollManager is LowLevelStringManipulator, Controlled { } function addPoll( - uint _startBlock, uint _endBlock, bytes _description) public onlySNTHolder returns (uint _idPoll) { - require(_endBlock > _startBlock && _endBlock > block.number); + require(_endBlock > block.number); _idPoll = _polls.length; _polls.length ++; Poll storage p = _polls[ _idPoll ]; - p.startBlock = _startBlock; + p.startBlock = block.number; p.endBlock = _endBlock; p.voters = 0; @@ -78,7 +77,7 @@ contract PollManager is LowLevelStringManipulator, Controlled { p.token = tokenFactory.createCloneToken( address(token), - _startBlock - 1, + block.number - 1, proposalName, token.decimals(), proposalSymbol, diff --git a/test/votingdapp.js b/test/votingdapp.js index e9105e3..277ddaf 100644 --- a/test/votingdapp.js +++ b/test/votingdapp.js @@ -82,7 +82,6 @@ describe("VotingDapp", function () { // Creating a proposal without holding SNT SHOULD FAIL! try { receipt = await PollManager.methods.addPoll( - blockNumber, blockNumber + 10, question) .send({from: accounts[8]}); @@ -96,7 +95,6 @@ describe("VotingDapp", function () { // Creating a proposal as a SNT holder receipt = await PollManager.methods.addPoll( - blockNumber, blockNumber + 10, question) .send({from: accounts[0]});