Skip to content
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

[sdk/python] NetworkTimestamp is using mainnet epoch as default one #244

Closed
cryptoBeliever opened this issue May 30, 2022 · 0 comments · Fixed by #248
Closed

[sdk/python] NetworkTimestamp is using mainnet epoch as default one #244

cryptoBeliever opened this issue May 30, 2022 · 0 comments · Fixed by #248
Assignees
Labels
sdk-python Related to the Python SDK. Status: WIP This issue or PR is a work in progress.

Comments

@cryptoBeliever
Copy link
Contributor

Current Behaviour

Currently, when creating NetworkTimestamp (NEM or Symbol) and we do not pass epoch_time to methods to_datetime and from_datetime by default is used mainnet epoch time:

https://github.com/symbol/symbol/blob/dev/sdk/python/symbolchain/symbol/NetworkTimestamp.py#L6
https://github.com/symbol/symbol/blob/dev/sdk/python/symbolchain/nem/NetworkTimestamp.py#L6

What's the problem?

A developer using SDK may expect that the testnet network will be supported 'by default'. He may not notice that it's required to pass epoch time for the test net. This could also to problems when moving code from testing (testnet) to production (mainnet).

Expected Behaviour

Support for testnet as is supported in Facades. Maybe add Network (with added epoch time) as a parameter?

The corresponding issue for JS SDK: #243

@cryptoBeliever cryptoBeliever added Status: WIP This issue or PR is a work in progress. sdk-python Related to the Python SDK. labels May 30, 2022
Jaguar0625 added a commit that referenced this issue May 30, 2022
 problem: NetworkTimestamp is using mainnet epoch as default epoch.
          This makes using it with other networks more difficult.
solution: move to_datetime and from_datetime into Network class from NetworkTimestamp.
          provide network epoch to Network constructor.

  issues: #243, #244
Jaguar0625 added a commit that referenced this issue May 30, 2022
 problem: NetworkTimestamp is using mainnet epoch as default epoch.
          This makes using it with other networks more difficult.
solution: move to_datetime and from_datetime into Network class from NetworkTimestamp.
          provide network epoch to Network constructor.

  issues: #243, #244
Jaguar0625 added a commit that referenced this issue May 30, 2022
 problem: NetworkTimestamp is using mainnet epoch as default epoch.
          This makes using it with other networks more difficult.
solution: move to_datetime and from_datetime into Network class from NetworkTimestamp.
          provide network epoch to Network constructor.

  issues: #243, #244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdk-python Related to the Python SDK. Status: WIP This issue or PR is a work in progress.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants