-
Notifications
You must be signed in to change notification settings - Fork 724
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
Add a treasury growth test #5639
Conversation
e035f0a
to
103c1e3
Compare
37ef1f0
to
03c4e8a
Compare
8161251
to
1373341
Compare
1373341
to
1df7a53
Compare
cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldBlocks.hs
Outdated
Show resolved
Hide resolved
[] -> False | ||
xn:_ -> xn > x1 | ||
|
||
checkNonDecreasing :: (Ord a) => [a] -> Bool |
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.
Why not have this check in the handler? You would only need to check two consecutive epochs and you can do this by taking the length of the state Map EpochNo Integer
and comparing the values.
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 seems to be more clear than combining the epoch treasury values aggregation and check in the same place.
It also checks that nothing weird is not going on - that treasury is suddenly not decreasing after temporary growth.
Moreover, that's a useful debug information to have how the treasury value was changing in the test period if the test fails.
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.
Shouldn't the case [_] -> True
be false since we want to check consecutive epochs?
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.
Well, technically a single element set is non-decreasing. A single element set is ruled out by checkHasIncreased
, which returns False
for [_]
.
1df7a53
to
e3878bb
Compare
e3878bb
to
6fa902f
Compare
6fa902f
to
c18580c
Compare
Description
Tests that testnet genesis creates treasury which is growing in time.
Checklist
See Runnings tests for more details
CHANGELOG.md
for affected package.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7
Note on CI
If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.