This returns b
then increments a
(and fixes the initialization of b
):
contract test2 is test{
uint b;
function test2() {
b = a++;
}
function show() public returns(uint){
b = a++;
return b;
}
}
In general, yes, probably better to set static values for all the important test vars.
In the contract, now
is the block.timeStamp
.
This timeStamp is approximate in practice, with variance up to fifteen minutes.
I would inquire to the contract or blockchain to get the time that was actually used.
In similar situations, I've had the test wait for a mined block with a timestamp past a time I'm waiting for. I can see how this will be a problem if you have to wait 12 days.
Might be good to break down and parameterize the milestones so you can test with smaller intervals, so the whole thing can pass all tests in a minute or two. Possibly not satisfactory for a "final" test but sufficient for initial tests.
Hope it helps.
Best Answer
there is a datetime library you can find out more here https://github.com/pipermerriam/ethereum-datetime