-
Notifications
You must be signed in to change notification settings - Fork 162
Improve ImpTest
helpers
#5220
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
base: master
Are you sure you want to change the base?
Improve ImpTest
helpers
#5220
Conversation
2997716
to
a5d8109
Compare
c7f0287
to
8155e7c
Compare
4dffd56
to
4bbc441
Compare
4bbc441
to
ca9c96d
Compare
For some reason, these tests fail if we use certificates with deposits, so as a temporary measure we will avoid using deposits in these cases. Related: #4571
No longer necessary since the introduction of `genRegTxCert`, `genUnRegTxCert` `ShelleyEraImp` typeclass methods.
This reverts commit 9a06817 and related changes.
No longer necessary since the introduction of `genRegTxCert`, `genUnRegTxCert` `ShelleyEraImp` typeclass methods.
ca9c96d
to
318a7dc
Compare
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.
A few comments from me.
I love it, it's so cool how introducing these two methods genRegTxCert
and genUnRegTxCert
made it possible to remove all these variations of functions
Looks good to me, barring some version changes and changelog suggestions.
* Added `shelleyGenUnRegTxCert` | ||
* Added `genUnRegTxCert` to `ShelleyEraImp` | ||
* Added `shelleyGenRegTxCert` | ||
* Added `genRegTxCert` to `ShelleyEraImp` |
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.
I think we should increase the version in cabal for this to 1.17.1.0 probably, and also move the changelong in the corresponding section
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.
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.
In that PR that you mean, I added a commit containing some, but not all fixes , so - in hindsight - that might have been misleading.
I made now a PR to correct all problems, since this is an issue now across several PRs: #5307
genRegTxCert :: HasCallStack => Credential 'Staking -> ImpTestM era (TxCert era) | ||
|
||
genUnRegTxCert :: HasCallStack => Credential 'Staking -> ImpTestM era (TxCert era) |
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 HasCallStack
here? Can these fail?
module Test.Cardano.Ledger.Conway.ImpTest, | ||
exampleDijkstraGenesis, | ||
DijkstraEraImp, | ||
dijkstraGenRegTxCert, |
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.
Maybe expose also dijkstraGenUnRegTxCert
, for consistency? otherwise, don't expose either - as they're not yet needed?
If you expose them, you should update the version to 0.2.1.0 and add changelog to the corresponding section.
let cred = ScriptHashObj scriptHash | ||
void $ regDelegToDRep cred (Coin 1_000_000) DRepAlwaysAbstain | ||
ra <- getRewardAccountFor cred | ||
ra <- registerStakeCredential cred |
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 we also call delegateToDRep here, in order to preserve the logic of the test?
ra <- registerStakeCredential cred | |
ra <- registerStakeCredential cred | |
kh <- freshKeyHash | |
_ <- delegateToDRep (KeyHashObj kh) (Coin 1_000_000) DRepAlwaysAbstain |
|
||
### `testlib` | ||
|
||
* Added `shelleyGenUnRegTxCert` |
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.
You could mention removing shelleyEraSpecificSpec
* Added `shelleyGenUnRegTxCert` | |
* Remove shelleyEraSpecificSpec | |
* Added `shelleyGenUnRegTxCert` |
{-# OPTIONS_GHC -Wno-orphans #-} | ||
|
||
module Test.Cardano.Ledger.Babbage.Imp (spec, babbageEraSpecificSpec) where | ||
module Test.Cardano.Ledger.Babbage.Imp (spec) where |
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.
You could mention this change in CHANGELOG
, and probably increment the version of babbage package to 1.12.1.0
Description
Follow-up to #5137
Checklist
CHANGELOG.md
files updated for packages with externally visible changes.NOTE: New section is never added with the code changes. (See RELEASING.md).
.cabal
andCHANGELOG.md
files when necessary, according to theversioning process.
.cabal
files updated when necessary.NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
scripts/fourmolize.sh
).scripts/cabal-format.sh
).scripts/gen-cddl.sh
)hie.yaml
updated (usescripts/gen-hie.sh
).