Closed miguelmota closed 7 years ago
Ah. This is a testRPC issue, not a contract issue. TestRPC mines a block per-transaction, and not otherwise. Two possible solutions:
Run testrpc with the -b <seconds>
flag to make it mine blocks every arbitrary number of seconds.
Use the testRPC special evm_mine
RPC command. Here's an example of it being used in a slightly complex function that calls itself recursively to mine a specified number of blocks: https://github.com/skmgoldin/simple-token-sale/blob/master/test/sale.js#L120-L135
General documentation: https://github.com/ethereumjs/testrpc
evm_mime
did the trick. Thanks!
block timestamp remains the same when calling constant functions such as revealPeriodActive(). When there's an active commit period and then afterwards when the commit period should be over, the revealPeriodActive() is always false when it should be true (commitPeriodActive() is always true because of block.timestamp) and user can't reveal. Need some sort "update()" method like in Registry.sol to mine a new block. Calling "updateStatus()" in Registry.sol throws an error during this phase.