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

cosmwasm: update cw wormhole rust tests #4190

Merged
merged 7 commits into from
Dec 19, 2024

Conversation

kakucodes
Copy link
Collaborator

@kakucodes kakucodes commented Dec 13, 2024

Add Integration Tests for CW Wormhole Contract

This PR introduces comprehensive integration tests for the CW Wormhole contract using cw-multi-test, with a focus on end-to-end testing of core functionality.

Key Changes

  • Implemented thorough integration tests for SubmitVAA logic covering:

    • Success paths with valid VAA submission and processing
    • Failure cases and error handling
    • Verification of query responses and state changes
  • Enhanced test infrastructure:

    • Added helper methods for VAA generation and signing
    • Improved WormholeKeeper flexibility to support different guardian sets
    • Created local test environment setup utilities (potential candidate for future shared package)

Testing Approach

The tests take a high-level integration approach, simulating the full application and contract interactions with accurate state representation and signature verification. This provides stronger guarantees about the contract's behavior in realistic scenarios compared to unit tests alone.

Next Steps

Once we upgrade to a newer version of cosmwasm-std (and therefore cw-multi-test), we can:

  • Remove #[ignored] tags from the currently skipped tests
  • Add integration tests covering the PostMessage functionality

@kakucodes kakucodes force-pushed the chore/update-cw_wormhole-rust-tests branch from 755fe1d to 9225a2e Compare December 13, 2024 15:46
@kakucodes kakucodes force-pushed the chore/update-cw_wormhole-rust-tests branch from 9225a2e to f9c880f Compare December 13, 2024 15:54
@kakucodes kakucodes marked this pull request as ready for review December 13, 2024 16:44
Copy link
Collaborator

@joelsmith-2019 joelsmith-2019 left a comment

Choose a reason for hiding this comment

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

Went over all code changes with Marc & everything's looking good.

Copy link
Contributor

@nik-suri nik-suri left a comment

Choose a reason for hiding this comment

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

LGTM. Verified that this change only affects non-functional testing code.

@kakucodes kakucodes merged commit 7ef1159 into main Dec 19, 2024
28 checks passed
@kakucodes kakucodes deleted the chore/update-cw_wormhole-rust-tests branch December 19, 2024 01:08
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.

3 participants