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

Voting integration tests #4459

Merged
merged 13 commits into from
Feb 22, 2024

Conversation

paweljakubas
Copy link
Contributor

@paweljakubas paweljakubas commented Feb 20, 2024

In order to run Coway tests:

just conway-integration-tests-cabal-match VOTING_TRANSACTIONS

In order to run Babbage test:

just integration-tests-cabal-match TRANS_NEW_CREATE_12

In this PR voting: abstain and no_confidence will be demonstrated.

  • Babbage integration test showing error
  • Showing voting tx
  • Showing re-voting

Voting with delegation tests in separate PR
Voting to DRep in separate PR

Comments

Issue Number

adp-3257

@paweljakubas paweljakubas self-assigned this Feb 20, 2024
@paweljakubas paweljakubas force-pushed the paweljakubas/adp-3257/voting-integration-tests branch from ede9f8f to 89db466 Compare February 21, 2024 15:03
@paweljakubas paweljakubas marked this pull request as ready for review February 21, 2024 15:04
@paweljakubas paweljakubas force-pushed the paweljakubas/adp-3257/voting-integration-tests branch 2 times, most recently from 859308c to c96da50 Compare February 21, 2024 15:19
lib/integration/cardano-wallet-integration.cabal Outdated Show resolved Hide resolved
@@ -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"
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

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

noConway using _mainEra ctx >= ApiConway

Hm. Although if you change noConway, then this symmetry is odd:

Skärmavbild 2024-02-22 kl  16 15 14

Eh. It might be fine 🤷‍♂️ Or maybe it should be preConway or noConwayOrLater instead 🤔

Copy link
Member

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 🤔

Comment on lines 100 to 104
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
Copy link
Member

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

Suggested change
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?

Copy link
Contributor Author

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

Copy link
Member

@Anviking Anviking Feb 22, 2024

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 []

@paweljakubas paweljakubas force-pushed the paweljakubas/adp-3257/voting-integration-tests branch from c96da50 to 838cf34 Compare February 22, 2024 08:53
Copy link
Member

@Anviking Anviking left a 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

@paweljakubas paweljakubas added this pull request to the merge queue Feb 22, 2024
Merged via the queue into master with commit 1076547 Feb 22, 2024
3 checks passed
@paweljakubas paweljakubas deleted the paweljakubas/adp-3257/voting-integration-tests branch February 22, 2024 16:29
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.

2 participants