Removing start block
This commit is contained in:
parent
a3807a8478
commit
df786d1536
|
@ -53,19 +53,18 @@ contract PollManager is LowLevelStringManipulator, Controlled {
|
||||||
}
|
}
|
||||||
|
|
||||||
function addPoll(
|
function addPoll(
|
||||||
uint _startBlock,
|
|
||||||
uint _endBlock,
|
uint _endBlock,
|
||||||
bytes _description)
|
bytes _description)
|
||||||
public
|
public
|
||||||
onlySNTHolder
|
onlySNTHolder
|
||||||
returns (uint _idPoll)
|
returns (uint _idPoll)
|
||||||
{
|
{
|
||||||
require(_endBlock > _startBlock && _endBlock > block.number);
|
require(_endBlock > block.number);
|
||||||
|
|
||||||
_idPoll = _polls.length;
|
_idPoll = _polls.length;
|
||||||
_polls.length ++;
|
_polls.length ++;
|
||||||
Poll storage p = _polls[ _idPoll ];
|
Poll storage p = _polls[ _idPoll ];
|
||||||
p.startBlock = _startBlock;
|
p.startBlock = block.number;
|
||||||
p.endBlock = _endBlock;
|
p.endBlock = _endBlock;
|
||||||
p.voters = 0;
|
p.voters = 0;
|
||||||
|
|
||||||
|
@ -78,7 +77,7 @@ contract PollManager is LowLevelStringManipulator, Controlled {
|
||||||
|
|
||||||
p.token = tokenFactory.createCloneToken(
|
p.token = tokenFactory.createCloneToken(
|
||||||
address(token),
|
address(token),
|
||||||
_startBlock - 1,
|
block.number - 1,
|
||||||
proposalName,
|
proposalName,
|
||||||
token.decimals(),
|
token.decimals(),
|
||||||
proposalSymbol,
|
proposalSymbol,
|
||||||
|
|
|
@ -82,7 +82,6 @@ describe("VotingDapp", function () {
|
||||||
// Creating a proposal without holding SNT SHOULD FAIL!
|
// Creating a proposal without holding SNT SHOULD FAIL!
|
||||||
try {
|
try {
|
||||||
receipt = await PollManager.methods.addPoll(
|
receipt = await PollManager.methods.addPoll(
|
||||||
blockNumber,
|
|
||||||
blockNumber + 10,
|
blockNumber + 10,
|
||||||
question)
|
question)
|
||||||
.send({from: accounts[8]});
|
.send({from: accounts[8]});
|
||||||
|
@ -96,7 +95,6 @@ describe("VotingDapp", function () {
|
||||||
// Creating a proposal as a SNT holder
|
// Creating a proposal as a SNT holder
|
||||||
|
|
||||||
receipt = await PollManager.methods.addPoll(
|
receipt = await PollManager.methods.addPoll(
|
||||||
blockNumber,
|
|
||||||
blockNumber + 10,
|
blockNumber + 10,
|
||||||
question)
|
question)
|
||||||
.send({from: accounts[0]});
|
.send({from: accounts[0]});
|
||||||
|
|
Loading…
Reference in New Issue