Skip to content

Hard coded dated seems to be outdated and PreICOProxyBuyer State enums doesn't match with Crowdsale enums #138

@voith

Description

@voith

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 return State.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 being 20/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions