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

Remove P-chain txsmock package #3528

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

StephenButtolph
Copy link
Contributor

@StephenButtolph StephenButtolph commented Nov 7, 2024

Why this should be merged

Currently, many of the verifier tests in the P-chain require mocking dependencies. These tests are brittle (and often incorrect).

This PR fixes TestVerifierVisitAtomicBlock. Previously the test was executing in the upgradetest.ApricotPhasePost6 environment. However, ApricotAtomicBlocks were actually disabled in upgradetest.ApricotPhase5. This test was completely broken and just happened to be passing.

Additionally, this test introduces significantly stronger testing for the actual behavior of the code by asserting the full blockState is equal (rather than verifying a subset of the fields).

How this works

This PR refactors:

  • TestVerifierVisitProposalBlock
  • TestVerifierVisitAtomicBlock
  • TestVerifierVisitStandardBlock
  • TestVerifierVisitStandardBlockWithDuplicateInputs (this test is merged with TestVerifierVisitStandardBlock due to the extent of duplicated code).

The newly refactored tests do not utilize any mocks.

How this was tested

CI.

Need to be documented in RELEASES.md?

No.

@StephenButtolph StephenButtolph added testing This primarily focuses on testing cleanup Code quality improvement labels Nov 7, 2024
@StephenButtolph StephenButtolph added this to the v1.11.13 milestone Nov 7, 2024
@StephenButtolph StephenButtolph self-assigned this Nov 7, 2024
@StephenButtolph StephenButtolph added this pull request to the merge queue Nov 7, 2024
Merged via the queue into master with commit 60e1a9f Nov 7, 2024
23 checks passed
@StephenButtolph StephenButtolph deleted the remove-p-chain-txsmock-package branch November 7, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement testing This primarily focuses on testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants