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

test: correct main_tests (subsidy) #19

Merged
merged 3 commits into from
Apr 12, 2021

Conversation

SmartArray
Copy link

@SmartArray SmartArray commented Apr 2, 2021

DigiByte specific main_tests (subsidy)

What is the intention of this PR?

This PR fixes the main_tests with DigiByte's specific Supply Curve Parameters.
Unfortunately, there have been many hard forks along the road of DigiByte, and almost all of them seem to have altered the supply parameters, which basically means we can't just loop through the halvings and validate the supply curve.

Be warned: This unit test was adapted to check the whole supply curve, even if the supply curve itself is erroneous. A new PR which alters the supply curve parameters must also provide an updated main_tests unit test.
This test will take some time to run due to the huge number of blocks it iterates through (6-8 min). The new code, in which the supply curve parameters have been altered, needs 6 different loops to test each and every hard fork (starting here: https://github.com/SmartArray/digibyte/blob/1dde1ec334a33e756a0724a3a0c679b16143bc80/src/test/main_tests.cpp#L62)

Description of the changes

The commit SmartArray@5747bb3 updated the main_tests unit test in order to test DigiBytes Subsidy.

SmartArray@1dde1ec adds a major algorithmical optimization in order to drastically reduce the runtime of this unit test.

How to verify?

  1. Change to the directory src/test
  2. Compile the test suite
  3. Run it using
./test_digibyte --run_test=main_tests

Expected outcome

$ ./test_digibyte --run_test=main_tests
Running 2 test cases...
*** No errors detected

Remarks

This doesn't fix the issue discussed in #20

src/test/main_tests.cpp Outdated Show resolved Hide resolved
@SmartArray SmartArray marked this pull request as ready for review April 4, 2021 07:14
Copy link
Member

@gto90 gto90 left a comment

Choose a reason for hiding this comment

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

utACK

@SmartArray SmartArray changed the title test: correct main_tests test: correct main_tests (subsidy) Apr 7, 2021
@SmartArray SmartArray closed this Apr 8, 2021
@SmartArray SmartArray deleted the tests/main_tests branch April 8, 2021 05:12
@SmartArray SmartArray restored the tests/main_tests branch April 8, 2021 05:12
@SmartArray SmartArray reopened this Apr 8, 2021
Copy link

@digicontributer digicontributer left a comment

Choose a reason for hiding this comment

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

ACK

@gto90 gto90 merged commit e70d45a into DigiByte-Core:develop Apr 12, 2021
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.

3 participants