-
Notifications
You must be signed in to change notification settings - Fork 213
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
Voting integration tests #4459
Voting integration tests #4459
Conversation
ede9f8f
to
89db466
Compare
859308c
to
c96da50
Compare
@@ -4351,6 +4351,21 @@ spec = describe "NEW_SHELLEY_TRANSACTIONS" $ do | |||
, expectField #policyId (`shouldBe` (ApiT tokenPolicyId')) | |||
] | |||
|
|||
it "TRANS_NEW_CREATE_12 - Cannot vote in Babbage" $ \ctx -> runResourceT $ do | |||
noConway ctx "voting supported in Conway onwards and tested in API.Conway module" |
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 will break when a new era is added — let's check _mainEra ctx >= ApiConway
instead (or the inverse)
Also — maybe — it might make more sense to say when (_mainEra ctx <= ApiBabbage) $ it ...
instead of when ... $ pendingWith ...)
as the use of pending otherwise would suggest the test should be fixed.
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.
changed noConway
using _mainEra ctx >= ApiConway
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.
This will break when a new era is added
Although, this babbage only test is going to become untested very soon after the HF when we stop running integration tests in Babbage, so if it's around for the next era it may be deletable unless intended to be kept for theoretical manual runs 🤔
lib/integration/scenarios/Test/Integration/Scenario/API/Conway.hs
Outdated
Show resolved
Hide resolved
lib/integration/scenarios/Test/Integration/Scenario/API/Conway.hs
Outdated
Show resolved
Hide resolved
lib/integration/scenarios/Test/Integration/Scenario/API/Shelley/TransactionsNew.hs
Outdated
Show resolved
Hide resolved
let getSrcWallet = | ||
let endpoint = Link.getWallet @'Shelley src | ||
in request @ApiWallet ctx endpoint Default Empty | ||
eventually "Wallet is neither voting nor delegating" $ do | ||
getSrcWallet >>= flip verify |
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 the response in src
should be good enough already and we could drop this
let getSrcWallet = | |
let endpoint = Link.getWallet @'Shelley src | |
in request @ApiWallet ctx endpoint Default Empty | |
eventually "Wallet is neither voting nor delegating" $ do | |
getSrcWallet >>= flip verify |
and just verify src
instead?
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.
eventually
not needed here, you are right
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 getSrcWallet
could go away too if you want when you have src :: ApiWallet
. Although the expectField
helper in particular would not work when the wallet isn't wrapped with the http response info, so it would have to be
src ^. #delegation `shouldBe` notDelegating []
c96da50
to
838cf34
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.
Looks sensible to me! Just one more comment / potential concern on noConway
In order to run Coway tests:
In order to run Babbage test:
In this PR voting: abstain and no_confidence will be demonstrated.
Voting with delegation tests in separate PR
Voting to DRep in separate PR
Comments
Issue Number
adp-3257