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

randomize completed trade info #1119

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

fa2a5qj3
Copy link
Contributor

@fa2a5qj3 fa2a5qj3 commented Jul 9, 2024

Fixes #1099
Implements #1099 (comment) :

dates randomized within 24 hours, amounts randomized +/-5%.

@fa2a5qj3 fa2a5qj3 requested a review from woodser as a code owner July 9, 2024 21:02

private static long fuzzTradeDate(long originalTimestamp) { // randomize completed trade info #1099
long adjustedTimestamp = ThreadLocalRandom.current().nextLong(
originalTimestamp-TimeUnit.HOURS.toMillis(24), originalTimestamp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will randomize between the original timestamp and 24 hours prior. Do we want +/- 12 hours instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally tested +/- 12 hours on stagenet, and it seemed strange to have trades show up for a future date.
So I switched it to choose a timestamp within the prior 24 hours.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, makes sense.

@woodser woodser merged commit db6cb23 into haveno-dex:master Jul 10, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

randomize completed trade info
2 participants