-
Notifications
You must be signed in to change notification settings - Fork 3
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
[WIP] Historical price and difficulty fetching and saving #16
Conversation
a = POW_Coin(coin.XMR) | ||
b = a.profitability(fiat.USD, 20000, 200, 0.1) | ||
print(b) | ||
print(b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use asserts for testing.
This assuming that there was no connection problem.
Also reorder the requirements alphabetically
…ntary error handling
Accessing by height works fine. Accessing by timestamp is still not available, need to figure out how to get the index from the timestamp. Should I use a double index?
TODO: handle KeyboardCancellation to save partial data
target_height subestimation idea: loop: fetch blocks; check if the timestamp is in there: if yes, break; if not, fetch again until it is found
Line 191 requires two values being returned, even in the case the fetching is successful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default test()
calls must use subsample of data, because they're meant to be executed quickly.
The delta_height was always the same, because it did not consider the last known timestamp of the last block fetched in the previous iteration of the loop. Note that the v1 part (blocktime 60s) does not have this issue, because it always calculates delta_height from the last known timestamp. When falling in the second case (timestamp > xmr_blocktime_120), the first iteration must calculate the delta from the fork timestamp, while subsequent iterations must calculate.
results = [] | ||
try: | ||
print(f"Downloading headers from {start_height} to {end_height}") | ||
while (end_height - start_height >= batch_size): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop has to have any kind of max_iterations
fuse, where the max_iterations
can be a very large number.
No description provided.