-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard coded dated seems to be outdated and PreICOProxyBuyer
State enums doesn't match with Crowdsale
enums
#138
Comments
PreICOProxyBuyer
State enums doesn't match with cr PreICOProxyBuyer
State enums doesn't match with Crowdsale enums
PreICOProxyBuyer
State enums doesn't match with Crowdsale enumsPreICOProxyBuyer
State enums doesn't match with Crowdsale
enums
@villesundell Here's some investigation. The old populus used eth-testrpc, but the new populus uses eth-tester for testing.
|
Re ^ just setting the date to a distant future value in the test, as a fix: how about instead adding a delta to current timestamp? |
@petri That's a better fix. |
BTW looks like we have another implementation as well (with a nice way to set the freeze end): And both of these seem to have wrong return type in the annotation. |
We don't have |
https://github.com/TokenMarketNet/ico/blob/d80e6d1afe8569512e0b53e6e927354ef476b7bf/ico/tests/contracts/test_deploy_acceptance.py#L70-L72
In the code above it can be seen that the date has been hardcoded. Howver, the date has already passed away.
https://github.com/TokenMarketNet/ico/blob/d80e6d1afe8569512e0b53e6e927354ef476b7bf/ico/tests/contracts/test_deploy_acceptance.py#L97-L107
The above mentioned date is used to instantiate
PreICOProxyBuyer
.The
PreICOProxyBuyer
contract has the following states:https://github.com/TokenMarketNet/ico/blob/d80e6d1afe8569512e0b53e6e927354ef476b7bf/contracts/PreICOProxyBuyer.sol#L74
The
getState
function has the following logic:https://github.com/TokenMarketNet/ico/blob/d80e6d1afe8569512e0b53e6e927354ef476b7bf/contracts/PreICOProxyBuyer.sol#L305-L318
and the test has the following assertion:
https://github.com/TokenMarketNet/ico/blob/d80e6d1afe8569512e0b53e6e927354ef476b7bf/ico/tests/contracts/test_deploy_acceptance.py#L107
Since
now >= freezeEndsAt
,getState
will returnState.Refunding
which has a enum value of 3,and so the above assertion will fail.
The test was added on 28/08/2017 and the
freezeEndsAt
date being20/09/2017
, the test might have worked well at the time of adding.What I don't understand is that this test passed successfully till date, but after upgrading populus the test seems to fail.
how can it be fixed?
Simply set the date to a distant future value.
The text was updated successfully, but these errors were encountered: